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 Robin Dunn other posts by this author
Apr 30 2002 4:06AM messages near this date
Re: [wxPython] DrawLines and a bunch points | 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.

>      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.)

>           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.

> 
>      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.

--
Robin Dunn
Software Craftsman
robin@[...].com       Java give you jitters?
http://wxPython.org      Relax with wxPython!




_______________________________________________
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