summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Typo. (Andrew Dalke, without kjpylint)Guido van Rossum1999-05-031-1/+1
|
* No need to import string. (Andrew Dalke & kjpylint)Guido van Rossum1999-05-031-1/+0
|
* After the previous changes, func_normalize() turned out to be redundant.Guido van Rossum1998-09-211-60/+5
| | | | This simplified some other places in the code.
* Changes so that JPython can also use this version of profile.py.Guido van Rossum1998-09-211-25/+4
| | | | Suggested by Jim Hugunin.
* Comment out 't = t[0] + t[1]' in profiler_simulation() -- thisGuido van Rossum1998-09-211-1/+1
| | | | | | function is only used when running the calibration code, and it turns out that recent changes in the timing code caused this statement to raise an exception.
* A few lines were indented using spaces instead of tabs -- fix them.Guido van Rossum1998-03-261-10/+11
|
* Prefer clock() over times() for timer function, except on the Mac,Guido van Rossum1998-03-171-4/+7
| | | | | where we use GetTicks() -- its clock() is a crock, with only 1 second accuracy, I believe.
* Use better timer on the macGuido van Rossum1997-10-081-1/+18
| | | | | Open files in binary mode (Jack)
* /usr/local/bin/python -> /usr/bin/env pythonGuido van Rossum1996-11-271-1/+1
|
* Add main program similar to pdb.Guido van Rossum1996-10-011-0/+19
|
* change return values of simple run* functionsGuido van Rossum1996-05-281-4/+3
|
* more robust coding, adapted for macGuido van Rossum1995-09-301-16/+19
|
* exec() -> execGuido van Rossum1995-08-101-1/+1
|
* functions don't have a __name__ attributeGuido van Rossum1995-06-221-1/+1
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-330/+553
|
* * Mass change: get rid of all init() methods, in favor of __init__()Guido van Rossum1993-12-171-6/+4
| | | | | | | constructors. There is no backward compatibility. Not everything has been tested. * aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as comments)
* * profile.py, pdb.py: added help() functionGuido van Rossum1993-10-221-0/+12
| | | | | | * builtin.py: b/w compat for builtin -> __builtin__ name change * string.py: added atof() and atol() and corresponding exceptions * test_types.py: added test for list sort with user comparison function
* XEvent.py: Added support for ExposeEvent.Sjoerd Mullender1993-08-251-16/+33
| | | | | profile.py: Some speed improvements (I hope). rect.py: Bug fix in union().
* * ftplib.py: added abort() command (sends oob data).Guido van Rossum1993-05-241-2/+2
| | | | | | * Several modules: change "class C(): ..." to "class C: ...". * flp.py: support for frozen forms. * Added string.find() which is like index but returns -1 if not found
* Added a _v21 def to FL.py and added two new input field typesGuido van Rossum1992-09-021-138/+95
| | | | | | Added runcall(func, *args) interfaces to profile.py, bdb.py, pdb.py, wdb.py Added new module bisect.py and used it in sched.py. Mostly cosmetic changes to profile.py (changed output format).
* Initial revisionGuido van Rossum1992-04-211-0/+405