From: tim_one at email.msn.com (Tim Peters)
Date: Mon, 12 Apr 1999 15:52:50 GMT
Subject: bug report: profiler
In-Reply-To: <7es542$94v$1@beta.EMBL-Heidelberg.DE>
References: <7es542$94v$1@beta.EMBL-Heidelberg.DE>
Message-ID: <000001be84fc$84ba9d00$ac9e2299@tim>
Content-Length: 1482
X-UID: 590                                                  

[Ralph Heinkel]
> when trying to run the profiler calibration explained in the python
> documentation, I got the following error:
>
> Python 1.5.1 (#8, Dec 18 1998, 09:42:46)  [GCC 2.7.2.1] on linux2
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import profile
> >>> pr = profile.Profile()
> >>> print pr.calibrate(100)
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/lib/python1.5/profile.py", line 498, in calibrate
>     self.instrumented()
>   File "/usr/local/lib/python1.5/profile.py", line 515, in instrumented
>     self.profiler_simulation(a, a, a)
>   File "/usr/local/lib/python1.5/profile.py", line 520, in
> profiler_simulation
>     t = t[0] + t[1]
> AttributeError: __getitem__

Suggest you wait a day or two for 1.5.2 final to be released, or at least
extract a 1.5.2 profile.py; this was fixed quite some time ago (the profiler
uses one of several timing methods depending on the platform, but
profiler_simulation *assumed* a particular one was in use -- presumably the
one in use on the platform on which it was written <wink>).

BTW, calibration is a touchy process, and in my experience unless you always
run on a dedicated dead-quiet machine, the result of fiddling with it is
anomalies like negative reported runtimes.  Profiling to get a feel for
where the *bulk* of the time is being spent works fine without bothering.

a-percent-or-two-here-or-there-may-vary-with-the-humdity-ly y'rs  - tim






