Re: Version 6 graphics can be painfully slow
- To: mathgroup at smc.vnet.net
- Subject: [mg84844] Re: [mg84822] Version 6 graphics can be painfully slow
- From: Carl Woll <carlw at wolfram.com>
- Date: Wed, 16 Jan 2008 22:59:07 -0500 (EST)
- References: <200801160820.DAA07210@smc.vnet.net>
Szabolcs Horvát wrote:
>In some cases, version 6 graphics can be painfully slow. Consider this
>example:
>
>data = Table[{Random[], Random[]}, {100000}];
>Graphics[{PointSize[0.002], Point /@ data}, AspectRatio -> Automatic] //
>Show
>
>This used to work fine in version 5.2, but it takes forever to complete
>in version 6.0.1. I have a dataset with about 250 000 points that I
>would like to plot, so this problem is really annoying ...
>
>
Use Point[data] instead of Point/@data, and the speed will improve
greatly (around 90 times on my machine).
I don't know all the details here, but basically, graphics work by
having the kernel send information to the front end that the front end
then renders. By using Point[data], you are sending a much smaller
amount of data to the front end since data is packed, but Point/@data is
not. Also, if the front end gets a list of Point objects, it must do
additional processing that is avoided if you instead give a Point object
containing a list of points.
So, the rule of thumb to follow is to try to always use a single Point,
Line, Polygon, etc. primitive instead of a list of such primitives.
Carl Woll
Wolfram Research
>The strange thing is that as soon as the graphic appears, resizing is
>fast and works fine (especially with antialiasing disabled). So it is
>not the /drawing/ itself that takes so long.
>
>
>I really hope that these problems will be fixed in 6.1, but until then,
>does anyone have a suggestion for speeding this up?
>
>(At the moment I temporarily switch back to << Version5`Graphics`)
>
>Szabolcs
>
>
- References:
- Version 6 graphics can be painfully slow
- From: Szabolcs Horvát <szhorvat@gmail.com>
- Version 6 graphics can be painfully slow