[Stackless] How to profile python code running inside tasklets?

Heinrich Schmetterling heinrich.schmetterling at gmail.com
Mon Nov 8 20:48:54 CET 2010


thanks, that would be very useful. could you post your patch somewhere? i'm
looking to recompile my distribution and test as soon as possible. thanks
again,

heinrich



2010/11/7 Kristján Valur Jónsson <kristjan at ccpgames.com>

> Actually cProfile in the current stackless branch is stackless aware.
> The problem is with enabling profiling on _all_ tasklets.  I have such a
> patch with my local version, but it is not in the central version yet.
> There is the same profile with slprofile (something I wrote).
> The usage of cProfile would be:
>
> P = cProfile.Profile()
> P.enable()
> ... run your stackless program for a while
> p.disable()
> p.print_stats()
> or something like that.
>
> The change to enable profiling on all tasklets is very small and I should
> probably commit it to stackless...
>
> K
> -----Original Message-----
> From: stackless-bounces at stackless.com [mailto:
> stackless-bounces at stackless.com] On Behalf Of Andrew Francis
> Sent: Sunday, November 07, 2010 3:46
> To: stackless at stackless.com
> Cc: heinrich.schmetterling at gmail.com
> Subject: Re: [Stackless] How to profile python code running inside
> tasklets?
>
> Hi Heinrich:
>
> I know there is a module called slprofile. I am not sure where slprofile is
> located but I believe I have a copy of the module somewhere. I never had
> much luck with it but this is just probably me.
>
> Here is a URL about slprofile I have from 2008:
>
> http://www.stackless.com/pipermail/stackless/2008-December/003814.html
>
> Cheers,
> Andrew
>
> --- On Sat, 11/6/10, stackless-request at stackless.com <
> stackless-request at stackless.com> wrote:
>
> > From: stackless-request at stackless.com
> > <stackless-request at stackless.com>
> > Subject: Stackless Digest, Vol 82, Issue 2
> > To: stackless at stackless.com
> > Date: Saturday, November 6, 2010, 4:00 AM Send Stackless mailing list
> > submissions to
> >     stackless at stackless.com
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >     http://www.stackless.com/mailman/listinfo/stackless
> > or, via email, send a message with subject or body 'help'
> > to
> >     stackless-request at stackless.com
> >
> > You can reach the person managing the list at
> >     stackless-owner at stackless.com
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Stackless digest..."
> >
> >
> > Today's Topics:
> >
> >    1. How to profile python code running inside tasklets?
> >       (Heinrich Schmetterling)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Fri, 5 Nov 2010 16:50:11 -0700
> > From: Heinrich Schmetterling <heinrich.schmetterling at gmail.com>
> > To: stackless at stackless.com
> > Subject: [Stackless] How to profile python code running inside
> >     tasklets?
> > Message-ID:
> >
> > <AANLkTikfNn+_b8PkEvv9m+C=D6E328eCvhH0y7QyHe+n at mail.gmail.com<D6E328eCvhH0y7QyHe%2Bn at mail.gmail.com>
> >
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > I'm using cProfile and recently converted some functions to be run
> > inside tasklets. It doesn't look like cProfile can profile anything
> > run within stackless.run(). Is there a way to do so, or use another
> > profiler module to do so? Thanks,
> >
> > Heinrich
> > -------------- next part -------------- An HTML attachment was
> > scrubbed...
> > URL:
> > <http://www.stackless.com/pipermail/stackless/attachments/20101105/ff9
> > 060b3/attachment-0001.html>
> >
> > ------------------------------
> >
> > _______________________________________________
> > Stackless mailing list
> > Stackless at stackless.com
> > http://www.stackless.com/mailman/listinfo/stackless
> >
> > End of Stackless Digest, Vol 82, Issue 2
> > ****************************************
> >
>
>
>
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20101108/77f6dd78/attachment.html>


More information about the Stackless mailing list