summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions ↵Georg Brandl2010-10-061-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 82805-82806,83523-83527,83536,83538,83542,83546-83548,83550-83555,83558,83560 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r82805 | georg.brandl | 2010-07-11 11:42:10 +0200 (So, 11 Jul 2010) | 1 line #7935: cross-reference to ast.literal_eval() from eval() docs. ........ r82806 | georg.brandl | 2010-07-11 12:22:44 +0200 (So, 11 Jul 2010) | 1 line #9223: link to Command class reference, and move Command interface docs nearer to class docs. ........ r83523 | georg.brandl | 2010-08-02 14:06:18 +0200 (Mo, 02 Aug 2010) | 1 line #9209 and #7781: fix two crashes in pstats interactive browser. ........ r83524 | georg.brandl | 2010-08-02 14:20:23 +0200 (Mo, 02 Aug 2010) | 1 line #9428: fix running scripts from profile/cProfile with their own name and the right namespace. Same fix as for trace.py in #1690103. ........ r83525 | georg.brandl | 2010-08-02 14:36:24 +0200 (Mo, 02 Aug 2010) | 1 line Get rid of spurious "threading" entries in trace output. ........ r83526 | georg.brandl | 2010-08-02 14:40:22 +0200 (Mo, 02 Aug 2010) | 1 line Fix softspace relic. ........ r83527 | georg.brandl | 2010-08-02 14:48:46 +0200 (Mo, 02 Aug 2010) | 1 line #3821: beginnings of a trace.py unittest. ........ r83536 | georg.brandl | 2010-08-02 19:49:25 +0200 (Mo, 02 Aug 2010) | 1 line #8578: mention danger of not incref'ing weak referenced object. ........ r83538 | georg.brandl | 2010-08-02 20:10:13 +0200 (Mo, 02 Aug 2010) | 1 line #6928: fix class docs w.r.t. new metaclasses. ........ r83542 | georg.brandl | 2010-08-02 20:56:54 +0200 (Mo, 02 Aug 2010) | 1 line Move test_SimpleHTTPServer into test_httpservers. ........ r83546 | georg.brandl | 2010-08-02 21:16:34 +0200 (Mo, 02 Aug 2010) | 1 line #7973: Fix distutils options spelling. ........ r83547 | georg.brandl | 2010-08-02 21:19:26 +0200 (Mo, 02 Aug 2010) | 1 line #7386: add example that shows that trailing path separators are stripped. ........ r83548 | georg.brandl | 2010-08-02 21:23:34 +0200 (Mo, 02 Aug 2010) | 1 line #8172: how does one use a property? ........ r83550 | georg.brandl | 2010-08-02 21:32:43 +0200 (Mo, 02 Aug 2010) | 1 line #9451: strengthen warning about __*__ special name usage. ........ r83551 | georg.brandl | 2010-08-02 21:35:06 +0200 (Mo, 02 Aug 2010) | 1 line Remove XXX comment that was displayed. ........ r83552 | georg.brandl | 2010-08-02 21:36:36 +0200 (Mo, 02 Aug 2010) | 1 line #9438: clarify that constant names also cannot be assigned as attributes. ........ r83553 | georg.brandl | 2010-08-02 21:39:17 +0200 (Mo, 02 Aug 2010) | 1 line Remove redundant information. ........ r83554 | georg.brandl | 2010-08-02 21:43:05 +0200 (Mo, 02 Aug 2010) | 1 line #7280: note about nasmw.exe. ........ r83555 | georg.brandl | 2010-08-02 21:44:48 +0200 (Mo, 02 Aug 2010) | 1 line #8861: remove unused variable. ........ r83558 | georg.brandl | 2010-08-02 22:05:19 +0200 (Mo, 02 Aug 2010) | 1 line #8648: document UTF-7 codec functions. ........ r83560 | georg.brandl | 2010-08-02 22:16:18 +0200 (Mo, 02 Aug 2010) | 1 line #9087: update json docstrings -- unicode and long do not exist anymore. ........
* Merged revisions 79271 via svnmerge fromVictor Stinner2010-03-221-4/+1
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r79271 | victor.stinner | 2010-03-22 02:58:35 +0100 (lun., 22 mars 2010) | 4 lines Issue #4282: Fix the main function of the profile module for a non-ASCII script, open the file in binary mode and not in text mode with the default (utf8) encoding. ........
* Merged revisions 74775 via svnmerge fromMatthias Klose2009-09-131-2/+2
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74775 | matthias.klose | 2009-09-13 17:18:53 +0200 (So, 13 Sep 2009) | 9 lines Merged revisions 74773 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74773 | matthias.klose | 2009-09-13 17:09:24 +0200 (So, 13 Sep 2009) | 2 lines Issue #6635: Fix profiler printing usage message. ........ ................
* Kill execfile(), use exec() insteadNeal Norwitz2007-08-121-1/+6
|
* - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;Guido van Rossum2007-02-111-2/+2
| | | | | | | | | | and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-8/+8
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Patch #1550800: make exec a function.Georg Brandl2006-09-061-1/+1
|
* Get rid of dict.has_key(). Boy this has a lot of repercussions!Guido van Rossum2006-08-181-1/+1
| | | | | | Not all code has been fixed yet; this is just a checkpoint... The C API still has PyDict_HasKey() and _HasKeyString(); not sure if I want to change those just yet.
* test and fix for buggy handling of exceptions raised by C functions,Armin Rigo2005-09-201-1/+1
| | | | | causing the profiler to crash on an AssertionError if the same Python function catches multiple exceptions from C functions.
* Patch #645894: Use getrusage for computing the time consumption inMartin v. Löwis2005-03-031-2/+20
| | | | profile.py if available.
* Whitespace normalization.Tim Peters2005-01-101-3/+3
|
* Bug #489256: remove out of date and out of place profile.doc, and letJohannes Gijsbers2005-01-101-13/+3
| | | | profile.help() point at the library reference instead of profile.doc.
* Move code in __name__ == '__main__' block into main() function, rewrite code soJohannes Gijsbers2005-01-091-16/+14
| | | | there's no need to subclass OptionParser.
* Using repr() generates entries that the current stats package can'tNicholas Bastin2004-07-121-4/+4
| | | | collate, so setting it back to the function name
* Fix SF Bug #989066Nicholas Bastin2004-07-121-4/+4
|
* Whitespace normalization.Tim Peters2004-07-071-2/+2
|
* Enable the profiling of C functions (builtins and extensions)Nicholas Bastin2004-03-241-1/+30
|
* Add runctx to __all__.Guido van Rossum2004-03-231-1/+1
|
* Added command line options for profile.py - one for stats output fileNicholas Bastin2004-03-231-13/+27
| | | | and one for sort order when using stdout. Uses optparse.
* Added global runctx function to profile to fix SF Bug #716587Nicholas Bastin2004-03-221-0/+17
|
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-2/+2
| | | | From SF patch #852334.
* Remove unneeded import.Guido van Rossum2003-10-221-1/+0
|
* Replace a reduce() with sum().Raymond Hettinger2003-10-221-3/+2
|
* Get rid of many apply() calls.Guido van Rossum2003-02-271-1/+1
|
* Replaced .keys() with dictionary iteratorsRaymond Hettinger2002-06-021-4/+3
|
* Replace boolean test with is None.Raymond Hettinger2002-06-011-1/+1
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-2/+2
|
* Added a missing period at the end of an error message.Fred Drake2001-12-051-2/+2
|
* Minor code cleanups based on comments from Neal Norwitz.Fred Drake2001-10-171-3/+2
|
* Repair key stutter + auto-complete ugliness.Tim Peters2001-10-091-2/+2
|
* Allow the profiler's calibration constant to be specified in the constructorTim Peters2001-10-091-19/+27
| | | | | | | | call, or via setting an instance or class vrbl. Rewrote the calibration docs. Modern boxes are so friggin' fast, and a profiler event does so much work anyway, that the cost of looking up an instance vrbl (the bias constant) per profile event just isn't a big deal.
* A brand new implementation of Profile.calibrate(). This measures anTim Peters2001-10-091-41/+62
| | | | | | | | | actual run of the profiler, instead of timing a simplified simulation of part of what the profiler does. It computes a constant about 60% higher on my Win98SE box than the old method, and the new constant appears much more realistic. Deleted the undocumented simple(), instrumented(), and profiler_simulation() methods (which existed only to support the previous calibration method).
* Typo repair in comment.Tim Peters2001-10-071-1/+1
|
* Guido points out that the comments for self.cur[2] were subtly butTim Peters2001-10-071-17/+29
| | | | | | | | seriously wrong. This started out by just fixing the docs, but then it occurred to me that the doc confusion propagated into misleading vrbl names too, so I also renamed those to match reality. As a result, INO the time computations are much easier to understand now (within the limitations of vast quantities of 3-character names <wink>).
* At Guido's request, changed the code that's conceptually asserting stuffTim Peters2001-10-071-11/+9
| | | | to use assert stmts (was raising unexpected kinds of exceptions).
* Repair some longstanding comment errors:Tim Peters2001-10-071-4/+4
| | | | | | + The last index in the timing tuple is 4, not 5 (noted by Guido). + The poorly named trace_dispatch_i works with float return values too.
* Remove code and docs for the OldProfile and HotProfile classes: codeTim Peters2001-10-071-115/+0
| | | | | hasn't worked in years, docs were wrong, and they aren't interesting anymore regardless.
* The fix to profile semantics broke the miserable but advertised way toTim Peters2001-10-051-25/+26
| | | | | derive Profile subclasses. This patch repairs that, restoring negative tuple indices. Yuck? You bet.
* Hopefully fix the profiler right. Add a test suite that checks thatGuido van Rossum2001-10-041-18/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it deals correctly with some anomalous cases; according to this test suite I've fixed it right. The anomalous cases had to do with 'exception' events: these aren't generated when they would be most helpful, and the profiler has to work hard to recover the right information. The problems occur when C code (such as hasattr(), which is used as the example here) calls back into Python code and clears an exception raised by that Python code. Consider this example: def foo(): hasattr(obj, "bar") Where obj is an instance from a class like this: class C: def __getattr__(self, name): raise AttributeError The profiler sees the following sequence of events: call (foo) call (__getattr__) exception (in __getattr__) return (from foo) Previously, the profiler would assume the return event returned from __getattr__. An if statement checking for this condition and raising an exception was commented out... This version does the right thing.
* Undo previous patch; it did not quite work out.Fred Drake2001-10-031-1/+1
|
* Change the sense of a test in how the profiler interprets exception events.Fred Drake2001-09-271-1/+1
| | | | | This should fix a bug in how time is allocated during exception propogation (esp. in the presence of finally clauses).
* Fix two bugs detected by PyChecker: there's no need for redundantGuido van Rossum2001-08-091-1/+1
| | | | "import MacOS", and there *is* a need for "import operator".
* An import MacOS was missing after the code-rearranging. Added.Jack Jansen2001-06-191-0/+1
|
* Performance improvements to the profiler:Fred Drake2001-06-081-57/+93
| | | | | | | | | | | | | | | | | Ensure that all the default timers are called as functions, not an expensive method wrapper around a variety of different functions. Agressively avoid dictionary lookups. Modify the dispatch scheme (Profile.trace_dispatch_*(), where * is not 'call', 'exception' or 'return') so that the callables dispatched to are simple functions and not bound methods -- this reduces the number of layers of Python call machinery that gets touched. Remove a couple of duplicate imports from the "if __name__ == ..." section. This closes SF patch #430948.
* Add doc string for run from profile.doc. (pydoc motivates me to writeJeremy Hylton2001-03-141-5/+13
| | | | | | | | | | good doc strings.) Fix silly argument handling; was using *args but really wanted 1 optional arg. XXX Should profile.doc be merged into the documentation and removed from the Lib directory?
* __all__ for several more modulesSkip Montanaro2001-02-121-0/+1
|
* Whitespace normalization.Tim Peters2001-01-151-485/+485
|
* remove all occurence of math.rint() from the sourcesPeter Schneider-Kamp2000-08-101-1/+1
| | | | (and yes, "Currintly" also counts <0.5 wink>)
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-4/+4
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* More trivial comment -> docstring transformations by Ka-Ping Yee,Guido van Rossum2000-02-041-58/+52
| | | | | | | | | | | | | | | | | | who writes: Here is batch 2, as a big collection of CVS context diffs. Along with moving comments into docstrings, i've added a couple of missing docstrings and attempted to make sure more module docstrings begin with a one-line summary. I did not add docstrings to the methods in profile.py for fear of upsetting any careful optimizations there, though i did move class documentation into class docstrings. The convention i'm using is to leave credits/version/copyright type of stuff in # comments, and move the rest of the descriptive stuff about module usage into module docstrings. Hope this is okay.