Issue 3865: explain that profilers should be used for profiling, not benchmarking (original) (raw)

Issue3865

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:39 admin set github: 48115
2010-10-14 06:41:53 georg.brandl set status: open -> closedresolution: fixedmessages: +
2010-10-11 20:06:25 sandro.tosi set files: + issue3865-py3k.patchnosy: + sandro.tosimessages: + keywords: + patch
2010-07-10 05:49:57 terry.reedy set versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2008-09-14 12:35:32 effbot set messages: +
2008-09-14 11:47:39 effbot create