Skip to main content
100%

Canvas Path Benchmark

✓ Published0🌍 Public
GGerHobbelt
Last edited Sep 10, 2012
Created on Aug 12, 2012

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 description

Canvas 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

Similar vizzes