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 bryan cole other posts by this author
Apr 30 2002 9:51AM messages near this date
Re: [wxPython] DrawLines and a bunch points | RE: [wxPython] wxPython embedded in wxWindows...
I've found what appeared to be a local problem on my windows system
drawing a 50,000 segment polyline to a wxMemoryDC. I was using the
wxDC::Drawlines() function. On Linux the drawing was always fast and
always reproducible. On my windows system, things looked fine provided
the wxPEN had WIDTH=1. As soon as I set the pen width to 2 or more,
everything went pearshaped; the drawing slowed by >  2 orders of
magnitude for <2000 points. For more than 5000 points, the programs
crashed entirely.

I posted a test script a while back (25th Feb 2002) and other users
reported no problems on their WinNT system (I was using win98), so I
think it might be a bug in my graphics-card driver, or the card itself
(I guessing here!).

I can't test your script as I don't have weave installed. If you post a
non-weave version, I'll happily test it on linux.

Bryan

On Tue, 2002-04-30 at 05:06, Robin Dunn wrote:
>  >
>  > 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
-- 
Bryan Cole
Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge
CB4 0WG, United Kingdom.
tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382


_______________________________________________
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