gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Patch for /framework/Source/CPScatterPlot.m #257

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Improved the speed of calculatePointsToDraw:(BOOL *)pointDrawFlags 
forPlotSpace:(CPXYPlotSpace *)xyPlotSpace 
includeVisiblePointsOnly:(BOOL)visibleOnly by making the following changes:
1. removed the second loop through the data points and integrated the tests 
into the first loop
2. reduced the calls to compareToDecimal, which Instruments.app showed was a 
performance hit.  My assumption is that most graphs will show the full Y range 
but may limit the X range, so checking the X range first would cut the number 
of Y range checks.

Only issue with the code change - it's now harder to understand.

Original issue reported on code.google.com by keith.pe...@gmail.com on 13 Feb 2011 at 3:47

Attachments:

GoogleCodeExporter commented 9 years ago
What sort of performance improvement did you get overall? If it is a few 
percent, I would be inclined not to complicate the code. 80/20 rule.

If it is tens of percents, it would be worth it.

Original comment by drewmcco...@mac.com on 13 Feb 2011 at 10:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8364bbf3507c.

Original comment by eskr...@mac.com on 19 May 2011 at 1:00