Canvas Path Benchmark
This interactive canvas benchmark measures the time required to draw successive sets of 250 line segments on an HTML5 Canvas, up to 5,000 total segments, while cycling through eleven different globalCompositeOperation modes. It uses the Canvas 2D API with stroke paths and requestAnimationFrame for animation. The results table updates in real time, showing the elapsed time and per-set rendering time for each composition mode, revealing performance differences across operations like `source-over`, `lighter`, and `xor`.
AI-generated descriptionCanvas Path Benchmark �� <a href="http://bl.ocks.org/3331545" title="view this gist via bl.ocks.org">?</a> <a href="http://bl.ocks.org/GerHobbelt" title="view a list of all my gists at bl.ocks.org">8</a>
This example benchmarks the time taken to draw a line consisting of 5000 separate segments into an HTML5 Canvas, using any of the composition modes.
Watch the 'Time of Last Set' numbers to see the difference between the various composition modes while the benchmark progresses to plot 5000 line segments.
This benchmark accompanies this Canvas benchmark, which uses the 'source-over' default composition mode.
source: gist.github.com/gists/3331545