Canvas Creation vs Size change
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var ctx = document.createElement("canvas").getContext("2d");
var ctx2 = document.createElement("canvas").getContext("2d");
ctx2.canvas.width = 500;
ctx2.canvas.height = 500;
var ctx3 = document.createElement("canvas").getContext("2d");
ctx3.canvas.width = 1500;
ctx3.canvas.height = 1500;
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Create New |
|
pending… |
Change Size |
|
pending… |
Grab from empty |
|
pending… |
Grab from empty 2 |
|
pending… |
createImageData |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments