S
Steven D'Aprano
20004 function calls in 10.214 CPU seconds
This calls the method on the CLASS, instead of an instance. When I try it,
I get this:
TypeError: unbound method readgenome() must be called with bar instance as
first argument (got file instance instead)
So you're running something subtly different than what you think you're
running. Maybe you assigned bar = bar() at some point?
However, having said that, the speed difference does seem to be real: even
when I correct the above issue, I get a large time difference using
either cProfile.run() or profile.run(), and timeit agrees:
0.1940619945526123
That's a difference of two orders of magnitude, and I can't see why.