Ticket #2469 (closed enhancement: fixed )

Opened 2 years ago

Last modified 1 year ago

Use cProfile for twistd profiling on 2.5

Reported by: itamarst Assigned to: therve
Type: enhancement Priority: highest
Milestone: Component: core
Keywords: Cc: jack, twonds, zooko, dreid
Branch: branches/cprofile-2469 Author: therve
Launchpad Bug:

Attachments

cprofile.diff (0.6 kB) - added by jack 2 years ago.
patch to add cprofile support (falls back to profile for older pythons)

Change History

  2007-02-24 21:02:52+00:00 changed by jack

  • cc set to jack

  2007-03-02 17:16:35+00:00 changed by jack

  • attachment cprofile.diff added

patch to add cprofile support (falls back to profile for older pythons)

  2007-03-02 17:16:49+00:00 changed by jack

  • cc changed from jack to jack, twonds

  2007-07-06 07:37:59+00:00 changed by therve

  • owner changed from glyph to therve

  2007-09-24 20:02:52+00:00 changed by zooko

  • cc changed from jack, twonds to jack, twonds, zooko

I just looked at the attached diff and it looks right. What's the next step to push this into trunk?

In a related issue:

http://docs.python.org/lib/module-hotshot.html

-- this says "For common usages it is recommended to use cProfile instead. hotshot is not maintained and might be removed from the standard library in the future."

So perhaps the logic of using hotshot by default and falling back to profile/cProfile should be reversed to use profile/cProfile by default.

  2007-09-25 07:43:55+00:00 changed by therve

The problem is that currently twistd is very hard to test (because of a structure problem), and no feature will be added before we manage to test it.

The ticket with the highest priority on this subject is #2571, but I'm unable to progress on it. Any help here is welcome :).

  2008-02-12 12:51:49+00:00 changed by therve

  • branch set to branches/cprofile-2469
  • author set to therve

(In [22523]) Branching to 'cprofile-2469'

  2008-02-12 12:57:19+00:00 changed by therve

(In [22524]) Add cprofile runner, with tests.

Refs #2469

  2008-02-12 12:58:47+00:00 changed by therve

  • keywords set to review
  • owner deleted
  • priority changed from low to highest

  2008-02-14 03:28:37+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

twisted.test.test_twistd.AppProfilingTestCase.test_cProfile and twisted.test.test_twistd.AppProfilingTestCase.test_cProfileSaveStats fail on the dumb debian pstats-less configuration. Guess they should check pstats availability and skip if it is not around.

  2008-02-14 13:06:46+00:00 changed by therve

  • keywords set to review
  • owner deleted

Thanks for the check, it looks better.

  2008-02-18 23:24:57+00:00 changed by dreid

  • owner set to therve

Great work as always therve, however my gut reaction is that the AppProfiler?.profilers dictionary should be keyed on the module name. i.e. profile, hotshot, and cProfile with an uppercase P.

In fact we call self._reportImportError("cProfile", e) when "cprofile" is specified on the command line, so I definitely think this needs to be addressed.

  2008-02-18 23:25:36+00:00 changed by dreid

  • cc changed from jack, twonds, zooko to jack, twonds, zooko, dreid
  • keywords deleted

  2008-02-19 08:56:19+00:00 changed by therve

(In [22621]) Rename option flag to cProfile.

Refs #2469

  2008-02-19 09:10:53+00:00 changed by therve

  • keywords set to review
  • owner deleted

  2008-02-19 18:29:49+00:00 changed by dreid

  • keywords deleted
  • owner set to therve

Thanks therve, this looks great, merge away.

  2008-02-19 20:43:31+00:00 changed by therve

  • status changed from new to closed
  • resolution set to fixed

(In [22627]) Merge cprofile-2469

Author: therve Reviewers: dreid, exarkun Fixes #2469

Add cProfile to the list of available profilers for twistd.

Note: See TracTickets for help on using tickets.