M.-A. Lemburg wrote: > FWIW, these are my findings on the various timing strategies:
Correction (due to a bug in my pybench dev version): > * Windows: > > time.time() > - not usable; I get timings with an error interval of roughly 30% > > GetProcessTimes() > - not usable; I get timings with an error interval of up to 100% > with differences in steps of 15.626ms > > time.clock() > - error interval of less than 10%; overall < 0.5% > > * Linux: > > time.clock() > - not usable; I get timings with error interval of about 30% > with differences in steps of 100ms This should read: steps of 10ms. time.clock() uses POSIX clock ticks which are hard-wired to 100Hz. > time.time() > - error interval of less than 10%; overall < 0.5% > > resource.getrusage() > - error interval of less than 10%; overall < 0.5% > with differences in steps of 10ms This should read: steps of 1ms. The true clock tick frequency on the test machine is 1kHz. > clock_gettime() > - these don't appear to work on my box; even though > clock_getres() returns a promising 1ns. > > All measurements were done on AMD64 boxes, using Linux 2.6 > and WinXP Pro with Python 2.4. pybench 2.0 was used (which is > not yet checked in) and the warp factor was set to a value that > gave benchmark rounds times of between 2.5 and 3.5 seconds, > ie. short test run-times. > > Overall, time.clock() on Windows and time.time() on Linux appear > to give the best repeatability of tests, so I'll make those the > defaults in pybench 2.0. > > In short: Tim wins, I lose. > > Was a nice experiment, though ;-) > > One interesting difference I found while testing on Windows > vs. Linux is that the StringMappings test have quite a different > run-time on both systems: around 2500ms on Windows vs. 590ms > on Linux (on Python 2.4). UnicodeMappings doesn't show such > a signficant difference. > > Perhaps the sprint changed this ?! -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun 06 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com