[IPython-dev] IPython test suite is slow on OS X fast on Windows

Brian Granger ellisonbg.net@gmail....
Fri Feb 20 18:53:44 CST 2009


After more investigation, I think it may be how the built-in Python on
OS X is built:

On OS X:

In [1]: def f():
  ...:     for i in range(100000):
  ...:         a = 1 + i
In [2]: %timeit f()
100 loops, best of 3: 11.8 ms per loop

Same hardware, but Windows:

In [1]: def f():
  ...:     for i in range(100000):
  ...:         a = 1 + i
In [2]: %timeit f()
100 loops, best of 3: 8.33 ms per loop

The ratio of these times is about the same as the ratio of the test suite times.

That's also depressing...

But, what is really puzzling is why the profiler shows that tokenize
is the bottleneck.

Thanks for timing this on your system Fernando.  I will post to the
list if I figure out anything more.

Brian

On Fri, Feb 20, 2009 at 4:48 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> On Fri, Feb 20, 2009 at 3:08 PM, Brian Granger <ellisonbg.net@gmail.com> wrote:
>> Hi,
>>
>> Last summer Min and I noticed that the IPython test suite is quite
>> fast on Windows, but really slow on OS X:
>>
>> 1.  2.53 Ghz Intel Core 2 Duo, Mac OS X 10.5.  Test suite takes 67 seconds
>>
>> 2.  *Same machine*, running Windows XP as VM in VMWare.  Test suite
>> takes 17 seconds.
>>
>> I have profiled the test suite and found some interesting and confusing things:
>>
>> On the OS X, calls to tokenize from ultraTB take up 30 seconds!  On
>> Windows, just 0.6 seconds.  Does anyone have an idea of what might be
>> going on here?
>
> That's very odd... On my fairly fast desktop using 64-bit ubuntu 8.10, I get
>
> Ran 431 tests in 28.629s
>
> Are you sure that the XP tests are really all completing identically?
>
> The tokenize stuff is very bizarre.  That's part of the stdlib, do you
> have a little self-contained example that we could use to track down
> the difference across machines?
>
> Cheers,
>
> f
>


More information about the IPython-dev mailing list