Closed GoogleCodeExporter closed 9 years ago
did it speed up anything?
length is a property of Array object, not a method, so it doesn't calculate
anything when you use points.length
(http://www.w3schools.com/jsref/jsref_length_array.asp)
Original comment by milke...@gmail.com
on 25 Nov 2011 at 5:00
You're right of course - it only made a 10ms difference on average (on a
dataset where the loop takes 4000ms to run), and the variability between runs
was about half this, so probably not significant.
What has made a massive difference, though, is pre-computing the circle symbol
by plotting it into a small in-memory canvas (outside the loop), and then
putting a drawImage call into the loop - but I imagine this is a bit too
specific to be included in the base code.
Thanks for the wonderful library, by the way.
Original comment by gavinpau...@gmail.com
on 26 Nov 2011 at 2:27
There are actually a couple of loop constructs even more efficient than the
ones you outlined, but the performance difference in all cases is absolutely
tiny. And since the standard zero-to-len loop is most familiar to people, it
wins in terms of clarity, maintainability, and ease of debugging.
So this is a good thought, but I'm marking it as 'wontfix'. We'll deal with
loop performance on a case-by-case basis, in response to profiling, rather than
across-the-board.
Original comment by dnsch...@gmail.com
on 23 May 2012 at 2:27
Original comment by dnsch...@gmail.com
on 4 Jun 2012 at 2:41
Original issue reported on code.google.com by
gavinpau...@gmail.com
on 25 Nov 2011 at 4:16