jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Specifically I was curious where the bottleneck for Processing.js was in the original test.
Using the native canvas api from within Processing.js is MUCH faster.
Perhaps the fastest.
See how to use it in your sketches here:
http://processingjs.org/articles/RenderingModes.html
<script src="https://github.com/downloads/processing-js/processing-js/processing-1.4.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
<script src="http://paperjs.org/assets/js/paper.js"></script>
<canvas id="context" width="100" height="100"></canvas>
<canvas id="paper" width="100" height="100"></canvas>
<canvas id="processing" width="100" height="100"></canvas>
<div id="rafael" width="100" height="100"></div>
<script>
var contextCanvas = document.getElementById("context");
var ctx = contextCanvas.getContext("2d");
var paperCanvas = document.getElementById("paper");
paper.setup(paperCanvas);
paper.install(window);
var paperRect;
var processingCanvas = document.getElementById("processing");
var pctx = processingCanvas.getContext('2d');
// use webgl
var processingInstance = new Processing(processingCanvas, null);
processingInstance.background(255);
processingInstance.size(300, 300, "3D");
var raphaelInstance = Raphael("rafael", 100, 100);
var refaelRect;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Context - rect |
| ready |
Context - path |
| ready |
Paper.js |
| ready |
Processing.js |
| ready |
Raphaël |
| ready |
Processing.js w/Canvas API |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.