Commit Graph

37 Commits

Author SHA1 Message Date
Brett Cannon
c3ce0e53ad Silence -3 warnings in pstats: a dict.has_key() usage and backport solution to
move from list.sort(cmp=) to key=.
2008-08-03 22:52:42 +00:00
Georg Brandl
66e7363c10 #1269: fix a bug in pstats.add_callers() and add a unit test file for pstats. 2008-01-21 10:24:59 +00:00
Georg Brandl
21d900f1d6 Bug #1603321: make pstats.Stats accept Unicode file paths. 2006-11-26 19:27:47 +00:00
Neal Norwitz
e588c2ba97 Fix errors found by pychecker.
I think these changes are correct, but I'm not sure.  Could someone
who knows how this module works test it?  It can at least start on
the cmd line.
2006-06-11 07:27:56 +00:00
Skip Montanaro
262fb9256b Allow pstats.Stats creator to specify an alternate to stdout. 2006-04-21 02:31:07 +00:00
Armin Rigo
a871ef2b3e Added the cProfile module.
Based on lsprof (patch #1212837) by Brett Rosen and Ted Czotter.
With further editing by Michael Hudson and myself.
History in svn repo: http://codespeak.net/svn/user/arigo/hack/misc/lsprof

* Module/_lsprof.c is the internal C module, Lib/cProfile.py a wrapper.
* pstats.py updated to display cProfile's caller/callee timings if available.
* setup.py and NEWS updated.
* documentation updates in the profiler section:
   - explain the differences between the three profilers that we have now
   - profile and cProfile can use a unified documentation, like (c)Pickle
   - mention that hotshot is "for specialized usage" now
   - removed references to the "old profiler" that no longer exists
* test updates:
   - extended test_profile to cover delicate cases like recursion
   - added tests for the caller/callee displays
   - added test_cProfile, performing the same tests for cProfile
* TO-DO:
   - cProfile gives a nicer name to built-in, particularly built-in methods,
     which could be backported to profile.
   - not tested on Windows recently!
2006-02-08 12:53:56 +00:00
Raymond Hettinger
6c92d76abc Removed deprecated method from pstats. 2004-12-05 03:28:00 +00:00
Walter Dörwald
70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Fred Drake
9c43910a27 - add a dump_stats() method similar to that of the profile.Profile class
- don't use "file" as the name of local variables
2003-05-14 14:28:09 +00:00
Guido van Rossum
68468eba63 Get rid of many apply() calls. 2003-02-27 20:14:51 +00:00
Raymond Hettinger
e0d4972acc Replaced .keys() with dictionary iterators 2002-06-02 18:55:56 +00:00
Raymond Hettinger
32200aeac6 Replaced obsolete stat module constants with equivalent attributes 2002-06-01 19:51:15 +00:00
Raymond Hettinger
16e3c427f3 Replace boolean test with is None. 2002-06-01 16:07:16 +00:00
Raymond Hettinger
54f0222547 SF 563203. Replaced 'has_key()' with 'in'. 2002-06-01 14:18:47 +00:00
Tim Peters
281084f798 Put the deprecated .ignore() method back where it was. 2001-10-08 06:28:18 +00:00
Tim Peters
7d01685738 Widespread random code cleanup.
Most of this code was old enough to vote.  Examples of cleanups:

+ Backslashes were used for line continuation even inside unclosed
  bracket structures, from back in the days that was still needed.

+ There was no use of % formats, and e.g. the old fpformat module was
  still used to format floats "by hand" in conjunction with rjust().

+ There was even use of a do-nothing .ignore() method to tack on to the
  end of a chain of method calls, else way back when Python would print
  the non-None result (as it does now in an interactive session -- it
  *used* to do that in batch mode too).

+ Perhaps controversial (although I can't imagine why for real <wink>),
  used augmented assignment where helpful.  Stuff like

      self.total_calls = self.total_calls + other.total_calls

  is just plain harder to follow than

      self.total_calls += other.total_calls
2001-10-08 06:13:19 +00:00
Andrew M. Kuchling
77f9caf633 Remove unused variable (PyChecker) 2001-08-13 14:52:37 +00:00
Martin v. Löwis
27c430e54e Patch #445538: add completion for pstats.py sort cmd. 2001-07-30 10:21:13 +00:00
Martin v. Löwis
66b6e192b9 Patch #416224: add readline completion to cmd.Cmd. 2001-07-28 14:44:03 +00:00
Martin v. Löwis
22adac50cb Patch #416220: Fix misplaced paren. 2001-06-07 05:49:05 +00:00
Fred Drake
e8187615e2 When guarding an import, only catch ImportError. 2001-05-11 19:21:41 +00:00
Eric S. Raymond
53b809d673 Added more help, and recovery from misspelled sort key arguments. 2001-04-26 07:32:38 +00:00
Eric S. Raymond
3c1858a589 Should resolve [ #416039 ] pstats browser crashes. 2001-04-14 15:16:05 +00:00
Eric S. Raymond
9cb98572af Import readline when possible to make the commaninterpreter UI nicer. 2001-04-14 01:48:41 +00:00
Tim Peters
613b2222cf Whitespace normalization. 2001-04-13 05:37:27 +00:00