anomalous speeds on macosx backend

It's very nice to have a native macosx backend. Many thanks to Michiel.
It does seem to work with ipython fine.
However, at present, it's not always faster than WXAgg.

With matplotlib svn r6575, python 2.5.2, everything compiled with
gcc4.0, 10.5.5, macbook pro 2.33GHz, 2GB memory

(i) interactive zooming of the plot window seems very slow
(ii) in scripts, pcolormesh and pcolor seem much slower than WXAgg,
though ax.pcolorfast is faster..
on a 1000x200 array:
pcolormesh:
[242-132:~/Python] agn% time python testspeed.py -dmacosx
32.717u 1.479s 0:43.76 78.1% 0+0k 0+23io 0pf+0w
242-132:~/Python] agn% time python testspeed.py -dWXAgg
1.226u 0.444s 0:05.80 28.6% 0+0k 0+25io 0pf+0w

pcolor:
[242-132:~/Python] agn% time python testspeed3.py -dmacosx
53.652u 2.099s 2:09.58 43.0% 0+0k 0+154io 0pf+0w
[242-132:~/Python] agn% time python testspeed3.py -dWXAgg
26.775u 1.542s 0:32.25 87.7% 0+0k 0+35io 0pf+0w

ax.pcolorfast:
[242-132:~/Python] agn% time python testspeed2.py -dmacosx
0.580u 0.331s 0:04.07 22.3% 0+0k 0+2io 0pf+0w
[242-132:~/Python] agn% time python testspeed2.py -dWXAgg
0.988u 0.423s 0:04.70 29.7% 0+0k 0+11io 0pf+0w

(iii) explicit creation of figure and axes instances seems to slow it
down radically in ipython:

e.g
In [3]: a= numpy.random.rand(100,200)
.. a few creations of plots and theitr removal, to get started..
With WxAgg backend:

In [8]: time pcolormesh(a)
CPU times: user 0.22 s, sys: 0.03 s, total: 0.25 s
Wall time: 0.25 s
Out[9]: <matplotlib.collections.QuadMesh object at 0x19661330>

With macosx backend:

In [39]: time pcolormesh(a)
CPU times: user 0.05 s, sys: 0.01 s, total: 0.06 s
Wall time: 0.08 s

so, 3x as fast.

However, explicitly creating the figure is much slower on macosx:

In [26]: time fig=figure();ax=fig.add_subplot(1,1,1);ax.pcolormesh(a);draw()
CPU times: user 3.33 s, sys: 0.03 s, total: 3.36 s
Wall time: 3.41 s
In [37]: time fig=figure();ax=fig.add_subplot(1,1,1);pcolormesh(a);draw()
CPU times: user 3.39 s, sys: 0.03 s, total: 3.42 s
Wall time: 3.46 s

while with wxagg there is little change in speed:
In [16]: time fig=figure();ax=fig.add_subplot(1,1,1);ax.pcolormesh(a);draw()
CPU times: user 0.21 s, sys: 0.03 s, total: 0.25 s
Wall time: 0.25 s

--George Nurser.

testspeed.py (130 Bytes)

testspeed2.py (172 Bytes)

testspeed3.py (168 Bytes)