From: Perry G. <pe...@st...> - 2004-05-28 15:59:46
|
John Hunter writes > One more comment here, mainly for Todd. > > Todd, I get 34 FPS on anim.py with GTKAgg and only 21 FPS with the > anim_tk.py, where both scripts are doing the same thing. The profiler > reveals a good chunk of the time is in > > 103 2.300 0.022 2.300 0.022 tkagg.py:4(blit) > > This may be a tk limitation, but I just wanted to point it out to you > in case there are any optimizations you can apply to that function. > > I'll include the anim_tk.py I'm using for profiling below. > > Cheers, > JDH I do believe it is a limitation of the tk api (which the blitting code uses) that makes writing to pixels of the tk window comparatively slow. It is possible to come up with a tk interface using tkinter3000( aka wck) and some hairy code to write directly to the window buffer. Eric Jones has done this for the chaco implementation. Porting it to matplotlib would take some work (how much I'm not quite sure). It is isn't important to us right now so we aren't going to do it for some time. If someone else is interested they are welcome to. It does mean writing a C or C++ implementation for each platform (i.e., X, win32, aqua). I know that the blitting can be improved by more than an order of magnitude in this way. Perry |