Re: [Numpy-discussion] profiling line by line

2008-09-29 Thread Arnar Flatberg
On Sat, Sep 27, 2008 at 2:36 AM, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: There is now! Excellent work! I've had no problem with using the

Re: [Numpy-discussion] profiling line by line

2008-09-27 Thread Robert Kern
On Sat, Sep 27, 2008 at 00:50, Fernando Perez [EMAIL PROTECTED] wrote: Hey, On Fri, Sep 26, 2008 at 5:36 PM, Robert Kern [EMAIL PROTECTED] wrote: There is now! Add import line_profiler ip.expose_magic('lprun', line_profiler.magic_lprun) to your ipy_user_conf.py . Mmh, should we

Re: [Numpy-discussion] profiling line by line

2008-09-26 Thread Robert Kern
On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: So, I could use some comments on the workflow. Does this look sensible to everyone? How else would you like to use it? Works for me. I would love to

Re: [Numpy-discussion] profiling line by line

2008-09-26 Thread Fernando Perez
Hey, On Fri, Sep 26, 2008 at 5:36 PM, Robert Kern [EMAIL PROTECTED] wrote: There is now! Add import line_profiler ip.expose_magic('lprun', line_profiler.magic_lprun) to your ipy_user_conf.py . Mmh, should we ship this out of the box in ipython? The C dependency is the only thing

Re: [Numpy-discussion] profiling line by line

2008-09-21 Thread Robert Cimrman
Robert Kern wrote: On Fri, Sep 19, 2008 at 07:00, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: Ah, found it. T_LONGLONG is a #define from structmember.h which is used to describe the types of attributes. Apparently, this was not added until Python 2.5. That particular member

Re: [Numpy-discussion] profiling line by line

2008-09-21 Thread Robert Kern
On Sun, Sep 21, 2008 at 02:09, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: On Fri, Sep 19, 2008 at 07:00, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: Ah, found it. T_LONGLONG is a #define from structmember.h which is used to describe the types of attributes.

Re: [Numpy-discussion] profiling line by line

2008-09-21 Thread Robert Cimrman
Robert Kern wrote: On Sun, Sep 21, 2008 at 02:09, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: On Fri, Sep 19, 2008 at 07:00, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: Ah, found it. T_LONGLONG is a #define from structmember.h which is used to describe the types

Re: [Numpy-discussion] profiling line by line

2008-09-21 Thread Robert Kern
On Sun, Sep 21, 2008 at 02:26, Robert Cimrman [EMAIL PROTECTED] wrote: Cool, then I have another one: $ ./kernprof.py -l pystone.py Traceback (most recent call last): File ./kernprof.py, line 173, in ? sys.exit(main(sys.argv)) File ./kernprof.py, line 138, in main import

Re: [Numpy-discussion] profiling line by line

2008-09-21 Thread Robert Cimrman
Robert Kern wrote: On Sun, Sep 21, 2008 at 02:26, Robert Cimrman [EMAIL PROTECTED] wrote: Cool, then I have another one: $ ./kernprof.py -l pystone.py Traceback (most recent call last): File ./kernprof.py, line 173, in ? sys.exit(main(sys.argv)) File ./kernprof.py, line 138, in

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Cimrman
Robert Kern wrote: On Thu, Sep 18, 2008 at 06:01, Robert Cimrman [EMAIL PROTECTED] wrote: Hi Robert, Robert Kern wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Cimrman
Ondrej Certik wrote: On Thu, Sep 18, 2008 at 4:12 PM, Ryan May [EMAIL PROTECTED] wrote: Ondrej Certik wrote: On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: It requires Cython and a C compiler to build. I'm still debating myself about the desired workflow for using

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Kern
On Fri, Sep 19, 2008 at 03:33, Robert Cimrman [EMAIL PROTECTED] wrote: I have Python 2.4.4 in pyconfig.h #define HAVE_LONG_LONG 1 in pyport.h: #ifdef HAVE_LONG_LONG #ifndef PY_LONG_LONG #define PY_LONG_LONG long long #endif #endif /* HAVE_LONG_LONG */ so it seems compatible with

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Ondrej Certik
On Fri, Sep 19, 2008 at 10:37 AM, Robert Cimrman [EMAIL PROTECTED] wrote: Ondrej Certik wrote: On Thu, Sep 18, 2008 at 4:12 PM, Ryan May [EMAIL PROTECTED] wrote: Ondrej Certik wrote: On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: It requires Cython and a C compiler

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Kern
On Wed, Sep 17, 2008 at 18:29, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 18:09, Ondrej Certik [EMAIL PROTECTED] wrote: This is what I am getting: $ ./kernprof.py -l pystone.py Wrote profile results to pystone.py.lprof $ ./view_line_prof.py pystone.py.lprof Timer unit:

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Cimrman
Robert Kern wrote: Ah, found it. T_LONGLONG is a #define from structmember.h which is used to describe the types of attributes. Apparently, this was not added until Python 2.5. That particular member didn't actually need to be long long, so I've fixed that. Great, I will try it after it

Re: [Numpy-discussion] profiling line by line

2008-09-19 Thread Robert Kern
On Fri, Sep 19, 2008 at 07:00, Robert Cimrman [EMAIL PROTECTED] wrote: Robert Kern wrote: Ah, found it. T_LONGLONG is a #define from structmember.h which is used to describe the types of attributes. Apparently, this was not added until Python 2.5. That particular member didn't actually need to

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
On Thu, Sep 18, 2008 at 1:29 AM, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 18:09, Ondrej Certik [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: Hi Robert, Robert Kern wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ryan May
Ondrej Certik wrote: On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: It requires Cython and a C compiler to build. I'm still debating myself about the desired workflow for using it, but for now, it only profiles functions which you have registered with it. I have made

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
So the timing raises a lot. For obvious reasons, that's the overhead of the profiler. But the problem is that then the timings just don't fit, e.g. if I sum the total time spent in subfunctions, it doesn't account for all the time printed on the respective line in the parent function. I

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Arnar Flatberg
On Wed, Sep 17, 2008 at 10:33 PM, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: It should be straightforward to make an ipython %magic, yes. There are

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 06:01, Robert Cimrman [EMAIL PROTECTED] wrote: Hi Robert, Robert Kern wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one who

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 10:03, Ondrej Certik [EMAIL PROTECTED] wrote: Anyway, back to work: Robert K., I noticed that if I profile some function, I get results like this for example: 40 307246952 6.6 [x,w] = p_roots(n) 41 307224192 3.4

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Gael Varoquaux
On Thu, Sep 18, 2008 at 02:54:13PM -0500, Robert Kern wrote: So here's what going on: I'm being clever (and possibly too clever). Oh no. Robert K. is too clever. We knew that, right ;). Gaƫl ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] profiling line by line

2008-09-17 Thread Arnar Flatberg
On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: So, I could use some comments on the workflow. Does this look sensible to everyone? How else would you like to use it? Works for me. I would love to use it as a part of an ipython session. Initially, I sprinkled som

Re: [Numpy-discussion] profiling line by line

2008-09-17 Thread Robert Kern
On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: So, I could use some comments on the workflow. Does this look sensible to everyone? How else would you like to use it? Works for me. I would love to

Re: [Numpy-discussion] profiling line by line

2008-09-17 Thread Ondrej Certik
On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one who profiles some hundred lines of

Re: [Numpy-discussion] profiling line by line

2008-09-17 Thread Robert Kern
On Wed, Sep 17, 2008 at 18:09, Ondrej Certik [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years!

Re: [Numpy-discussion] profiling line by line

2008-09-16 Thread Robert Kern
On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one who profiles some hundred lines of code and ends up with 90% of total time in the dot-function For the time

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Robert Kern
On Mon, Sep 15, 2008 at 05:27, Robin [EMAIL PROTECTED] wrote: Hi, I am using the prun feature of Ipython which is very helpful. I was wondering though if theres anything for Python that would allow line-by-line profiling (ie a time for each line of code) like the MATLAB profiler? I don't

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Arnar Flatberg
On Mon, Sep 15, 2008 at 5:18 PM, Robert Kern [EMAIL PROTECTED] wrote: I do have some Cython code that does this. It needs a little bit more work, though. I'll try to push it out soonish. That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Robin
On Mon, Sep 15, 2008 at 5:13 PM, Arnar Flatberg [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 5:18 PM, Robert Kern [EMAIL PROTECTED] wrote: I do have some Cython code that does this. It needs a little bit more work, though. I'll try to push it out soonish. That would make me an extremely

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Michael McNeil Forbes
The hotshot profiler used to do this, but I don't think it is really supported anymore... I have not used it in a while, but agree that a line-by-line profiler can be very nice. Michael. On Sep 15, 2008, at 6:27 AM, Robin wrote: Hi, I am using the prun feature of Ipython which is very

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread David Cournapeau
Michael McNeil Forbes wrote: The hotshot profiler used to do this, but I don't think it is really supported anymore... I have not used it in a while, but agree that a line-by-line profiler can be very nice. You can do it with kcachegrind, which is arguably more powerful, but it is a bit

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Robert Kern
On Mon, Sep 15, 2008 at 21:43, David Cournapeau [EMAIL PROTECTED] wrote: Michael McNeil Forbes wrote: The hotshot profiler used to do this, but I don't think it is really supported anymore... I have not used it in a while, but agree that a line-by-line profiler can be very nice. You can do

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread David Cournapeau
Robert Kern wrote: On Mon, Sep 15, 2008 at 21:43, David Cournapeau [EMAIL PROTECTED] wrote: You can do it with kcachegrind, which is arguably more powerful, but it is a bit a pain to set up. http://jcalderone.livejournal.com/21124.html No, that's with cProfile, which doesn't

[Numpy-discussion] profiling line by line

-- Thread Robin
-> [Numpy-discussion] profiling line by line numpy-discussion -- Thread -- -- Date -- <!-- google_ad_client = "pub-7266757337600734"; google_alternate_ad_url = "http://www.mail-