lookup-canvas-perf-base64

JavaScript performance comparison

Test case created by tss

Info

base64 headers tests

Preparation code

<canvas width="2250" height="1000" id="testCanvas" style="width: 100%; height: 500px">
</canvas>
<script src="https://dl.dropboxusercontent.com/u/24935738/jsperf/data.js"></script>
<script>
Benchmark.prototype.setup = function() {
    var canvas = document.getElementById('testCanvas');
    var ctx = canvas.getContext('2d');
    ctx.fillStyle = '#FFFFFF';
    ctx.fillRect(0,0,canvas.width, canvas.height);
   
    function run(replacement) {
    var textureBase64 = texture2Base64.replace('data:image/png;base64,', replacement);
   
    var img = new Image();
    img.src = textureBase64;
    ctx.drawImage(img, 0, 0);
    }
};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
empty
run('')
pending…
data
run('data:,')
pending…
database64
run('data:;base64,')
 
pending…
image
run('data:image;base64,')
pending…
normal
run('data:image/png;base64,')
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment