[wxPython] Re: Patch to wxPoint_LIST_Helper and friends

Gordon,
  For maximum speed you will have to put the plotting loops on the C++
side of the SWIG interface. Then the question becomes what sort of
container do you pass through the SWIG interface? I believe that the SWIG
documentation has an example of this.

Good Luck
JR

···

-----Original Message-----
From: Gordon Williams [mailto:g_will@cyberus.ca]
Sent: Tuesday, February 27, 2001 4:51 AM
To: wxPython List
Cc: tim.hochberg@ieee.org
Subject: [wxPython] Re: Patch to wxPoint_LIST_Helper and friends

Hi All,

I like the idea of being able to use Numeric Arrays for
plotting, but I am
concerned about the cost it will have in terms of performace
for some of my
code. I switched from tkinter to wxpython about a year and a half ago
because tkinter didnt have the performance that I needed for
plotting large
numbers of lines to the screen. (See some benchmarks around
that time for a
comparison of the two.) I need to have a very fast refresh rate (for
oscilloscope applications) therefore performance is important
to me. A 30%
hit in performace would not be welcome.

Is there some other way of achieving the Numeric goal without
impacting
existing performance?

Regards,

Gordon Williams

--------------------------------------------------------------
--------------
--------------
PERFORMANCE:

There was some question about how using the general sequence
protocol would
affect speed. As shown by the data below, there is a
significant impact: for
the best case (a list of tuples of ints) things slowed down
by about 50%.
However the speed of plotting Numeric arrays is improved by
over a factor of
four. The slowdown for the lists of tuples cases can be
eliminated by adding
special cases to the code, but at the expense of complexity.
I suspect that
most applications that are plotting large numbers of points
use Numeric, so
I think that the first and fourth rows in the table below are most
important. (This is obviously a somewhat biased view). I
personally don't
think the complexity that the fast version of the codes add
is worth the
speed gain, so the patch is against the simpler new version.
NEW-FAST is
included with this message as a separate file, but it has not
been tested or
even scrutinized very much.

Table: Times for plotting 50,000 points using PlotLines (see
testwxpatch.py):

TEST NEW NEW-FAST
           OLD
array: 0.134961007614 0.134145037987
(0.634264634192)
[(x,y)]: 0.104322197374 0.0881805369118
0.0870843082012
[[x,y]]: 0.108765723018 0.103665577608
(0.613360413125)
intarray: 0.086473224949 0.0866711830694
(0.626794075783)
[(intx,inty)]: 0.0548769187145 0.0394333916741
0.0387480531744
[[intx,inty]]: 0.0564195728787 0.0531457489709
(0.462688805421)

Values in parentheses were computed by first using map(tuple,
data) since
these wouldn't work directly with the old version.

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users