ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxPython-users
wxPython-users
Re: [wxPython] DrawLines and a bunch points
by eric other posts by this author
Apr 30 2002 6:14PM messages near this date
Re: [wxPython] DrawLines and a bunch points | Re: [wxPython] DrawLines and a bunch points
----- Original Message -----
From: "Robin Dunn" <robin@[...].com> 
To: <wxpython-users@[...].org> 
Sent: Tuesday, April 30, 2002 12:06 AM
Subject: Re: [wxPython] DrawLines and a bunch points


>  >
>  > All this background to ask some non-wxPython questions (though
>  related...):
>  >
>  >     1.  Can anyone verify that they get the same behavior with
>  >         DrawLines?  <I wondering if something is strange about
>  >         my machine setup>
> 
>  I always get between 0.25 and 0.60, depending on how much area needs
>  refreshed.

Thanks for the test.  It sounds like an idiosyncrasy of my machine.  I guess
that is better news than the alternative...

> 
>  >     2.  Does anyone have any insight into what is going on here?
>  >
> 
>  Not really.  There is some (probably) unnecessary overhead there though.
>  wxPython's DrawLines transforms the sequence into an array of wxPoint
>  objects and then calls the C++ DrawLines.  (On MSW the wxPoint object is the
>  same structure as MSW's POINT so another transform to call Polyline is not
>  needed.)

Right.  Well, for now, the extra overhead is a minor issue compared to the
PolyLine problem.  weave provides a way around the extra overhead in the final
tweaking stages, but, for now, I'm more interested in just getting the project
working with reasonable performance.

> 
>  >          a. Why is PolyLine fast for the initial call and slow for
>  >             subsequent calls with a large number of points?
>  >
>  >          b. Why is PolyLine slow for a large number of points?
>  >             Heck, 30000 isn't even all that large of a number.
> 
>  No idea.

Dag.  Me neither.

> 
>  >
>  >     3.  Does Linux have the same problem?
> 
>  I don't have Numeric installed there, so I don't know.
> 
>  >
>  >     4.  Am I missing an extra call somewhere that would fix all my
>  >         problems?
> 
>  We added DrawLineList to wxPython's DC in 2.3.2 or .1 that doesn't have the
>  transformation overhead described above.  It takes a sequence of
>  (x1,y1,x2,y2) sequences, and optionally a list of pens, and iterates through
>  it calling DrawLine.  You end up with a ton more win32 API calls, but no
>  transformation.

It doesn't sound like this is as good of a solution for drawing an array of
points.  I'll stick with DrawLines.

thanks for your help,
eric





_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
Thread:
eric
eric
Robin Dunn
bryan cole
bryan cole
eric
Robin Dunn
bryan cole

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved