sveinn-steinarsson/flot-downsample — pull request #9 by kontakt (2014-11-29 15:15:56+00:00)
Title: Optimization by consolidation and loop reduction

Some operations were repeated each loop when they really don't need to be.
The number is not needed to be an exact area but a number we can compare to, omitting the division saves an operation each loop, and nothing is lost.
Initializing the bucket boundaries saves two extra calculations each bucket loop, and only the newest edge needs to be generated.
Changing to ceil over floor+1 gives the same effective result.