Benchmarking some modules - strange result

Chris Angelico rosuav at
Sun Jan 25 03:24:25 CET 2015

On Sun, Jan 25, 2015 at 1:11 PM, Dan Stromberg <drsalists at> wrote:
> For simplicity, let's say I've been running the suite of performance
> tests within a single interpreter - so I test one module thoroughly,
> then move on to the next without exiting the interpreter.
> [chomp more details]

Do the modules import stuff that's staying imported? That could
majorly affect performance. What about .pyc files?

I don't know if you can truly reset the interpreter. Snapshotting
sys.modules and reinstating it afterwards would help, but there are
other concerns too. I would personally just restart the interpreter
each time, frankly; it's the easiest way to be sure.


More information about the Python-list mailing list