performance problems

Can you post a complete script that is slow for you?

    > Sure thing.

To assist in timing, I modified your script to call SystemExit on idle
-- that way we can get a pretty good measurement of how much time it
takes to load the libs and plot the figure. You can pass plot or
noplot or the script to compare the all the wx overhead with wx +
matplotlib.

While this is important, it's not the start up costs that concern me. I
know well the overhead incurred with an import. My problem is with the
time to actually perform the WX window painting as I've embedded matplot
lib into my own custom wxpanel.

Here are three runs on my system with and w/o plotting.

time python slow_example.py noplot

    0.401u 0.044s 0:00.61 72.1% 0+0k 0+0io 0pf+0w

time python slow_example.py noplot

    0.391u 0.048s 0:00.54 79.6% 0+0k 0+0io 0pf+0w

time python slow_example.py noplot

    0.394u 0.049s 0:00.51 84.3% 0+0k 0+0io 0pf+0w

time python slow_example.py plot

    0.612u 0.074s 0:01.04 65.3% 0+0k 0+0io 5pf+0w

time python slow_example.py plot

    0.628u 0.057s 0:00.81 82.7% 0+0k 0+0io 0pf+0w

time python slow_example.py plot

    update
    0.624u 0.057s 0:00.81 82.7% 0+0k 0+0io 0pf+0w

For comparable CPU utilization, the numbers are 0.51s w/o mpl and
0.81s w/ mpl.

Notice that the first run with plotting is considerably slower than
subsequent runs and that CPU utilization is lower. This suggests that
a large part of the runtime is being dominated by the load time of
the many large matplotlib modules.

I would argue that this isn't terribly useful without the addition
of profile data. The time _might_ be going to python namespace conversion
and dyload, but in my case it isn't. As per my first post, I noticed
an inordinate amount of time spent in the axes drawing functions. I can
provide more details shortly.

Here is another example that simply does 'from pylab import *'

cat test.py

    from pylab import *

time python test.py

    0.245u 0.074s 0:01.96 15.8% 0+0k 0+0io 72pf+0w

time python test.py

    0.248u 0.034s 0:00.30 90.0% 0+0k 0+0io 0pf+0w

time python test.py

    0.249u 0.030s 0:00.30 90.0% 0+0k 0+0io 0pf+0w

My guess is that your matplotlib runtime is being dominated by module
load time. This explains why Matt is getting 10 frames per second
(you only pay load costs once) and other users are complaining about
sluggishness when scripts launch.

Again, launch time is of no concern to me, only the window paint time.

I'm on the chicago campus, so I've you'd like to see my slow as molasses
code in action, that can be arranged. :slight_smile:

thanks

donour

···

On Jul 12, 2005, at 1:25 PM, John Hunter wrote:

Donour Sizemore donour@...677...|
Technical Programmer & Numerical Analyst |
Economics Research Center Ph: 773-834-4399 |
University of Chicago Office: Walker 303-a |