On Tue, 22 Sep 2009, Matthew McCormick (thewtex) wrote:

On Sat, Sep 19, 2009 at 2:49 PM, Jeremy Sanders
<jer...@jeremysanders.net> wrote:
Matthew McCormick (thewtex) wrote:

So, I have implemented my PyQt4/veusz application, which can be seen here:
http://mmmccormick.com/#tcd_analyze

It looks good, but the speed is not usable for a real dataset.  I've
got anti-aliasing turned off, which helps a lot, but it still needs a
ways to go.  Here is some profiling data I made with the cProfile
module:

Interesting... It looks like _getLinePoints in widgets/point.py is one of
the biggest problems. Is that correct? This is a function I have considered
recoding in C++, but SIP seems to be fairly painful to use so I've never got
that far.

Yeah, _getLinePoints seems to be one of the buggers.

I have done a couple of C Python extensions, and I like C++ much more
than C, but I haven't done anything with SIP/PyQt4.  I have heard that
Boost Python is nicer than SIP, which is what PySide uses
http://www.pyside.org/.  However, I don't have any first hard
experience with boost python either, and it is up to you if you want
to move to PySide.  From how you code is setup (veusz.qtall) porting
should be pretty trivial.

Boost is probably nicer, but it looks like PySide isn't quite ready yet as it is Linux only and the bindings it produces are currently very large. It looks like they may move away from boost::python, from what I read.

Sip probably isn't very hard and we could move to better solutions later as long as the C++ is as simple as possible.

What I really want to write is a function which takes several numpy arrays of X,Y points and adds them to a QPolygon, e.g.

poly = QPolygonF()
x1 = numpy.array(...)
y1 = numpy.array(...)
addPolyPoints(poly, x1, y1, x2, y2...)

where it would add (x1[0], y1[0]), then (x2[0], y2[0]), then (x1[1], y1[1])...

That would probably speed up quite a few parts of the program. I probably should make a quick benchmark to make sure that python is the real overhead here however.

Jeremy

--
Jeremy Sanders <jer...@jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053
_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à