This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: explain that profilers should be used for profiling, not benchmarking
Type: enhancement Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: effbot, georg.brandl, sandro.tosi
Priority: normal Keywords: patch

Created on 2008-09-14 11:47 by effbot, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue3865-py3k.patch sandro.tosi, 2010-10-11 20:06
Messages (4)
msg73213 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2008-09-14 11:47
You often see people using the profiler for benchmarking instead of
profiling.  I suggest adding a note that explains that the profiler
modules are designed to provide an execution profile for a given
program, not for benchmarking different libraries or, even worse,
benchmarking Python code against C libraries.  Point people to the
"timeit" module if they want resonably accurate results.

(and yes, it would be nice if the copyright text on the page

http://docs.python.org/dev/library/profile.html

was moved to the bottom of the page.  If necessary, add something like
"This description of the profile module is Copyright © 1994, by InfoSeek
Corporation, all rights reserved.  Full copyright message below" at the
top.)
msg73216 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2008-09-14 12:35
(the reason this is extra bad for C modules is that the profilers
introduce overhead for Python code, but not for C-level functions.  For
example, using the standard profiler to benchmark parser performance for
xml.etree.ElementTree vs. xml.etree.cElementTree will make ET appear to
be about 10 times slower than it actually is.)
msg118387 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-10-11 20:06
Hello,
Here's a patch that implement what's request by Fredrik.

Regards,
Sandro
msg118621 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-14 06:41
Freshed up and committed in r85451.
History
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48115
2010-10-14 06:41:53georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg118621
2010-10-11 20:06:25sandro.tosisetfiles: + issue3865-py3k.patch

nosy: + sandro.tosi
messages: + msg118387

keywords: + patch
2010-07-10 05:49:57terry.reedysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2008-09-14 12:35:32effbotsetmessages: + msg73216
2008-09-14 11:47:39effbotcreate