[IronPython] Weird performance issue

Glenn Jones glenn.k.jones+ipy at gmail.com
Tue Jan 6 15:07:18 CET 2009


Hi all,

More from the Resolver One upgrade:
We are seeing several performance failures in our tests, which we expect
because the performance profile of IPy2 is different to IPy1. There is one
that is perplexing and we hope that someone can give us some insight into
possible causes for us to investigate.

One of our performance tests only fails when it is preceded by other tests.
There is (as far as we can tell) no shared state between the tests. After
much poking around, we discovered that replacing a set with a list caused
the performance to improve from ~700ms down to ~100ms. We have been unable
get a minimal repro, so far. Here's a little more detail on the how the code
works:

class Thing(object):
    def run(arg1, arg2):
        * do some stuff
        s = set()
        * do stuff that populates s
        return list(s)

We create a Thing and call run so that the set contains an entry, if we then
create a new Thing and call the run method it takes 10 times longer than
expected.
If we change s = set to s = [] (and convert s.add to s.append, where
appropriate), and do the same as above, the second call to run behaves as we
expect. There is (at least in our code) nothing shared between the first
call to run and the second call.

Does anyone have any ideas about where we can look to work out what's
happening? Any suggestions for ways to diagnose this?

Thanks
Glenn & Kamil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090106/7b1ff33a/attachment.html>


More information about the Ironpython-users mailing list