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="http://thesis.web-pilot.cz/paper.min.js"></script>
<script src="https://github.com/downloads/processing-js/processing-js/processing-1.4.1.min.js"></script>
<script src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.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>
<span id="rafael"></span>
<script>
var contextCanvas = document.getElementById("context");
var ctx = contextCanvas.getContext("2d");
var paperCanvas = document.getElementById("paper");
paper.setup(paperCanvas);
var paperPath;
var processingCanvas = document.getElementById("processing");
var pctx = processingCanvas.getContext('2d');
var processingInstance = new Processing(processingCanvas, null);
processingInstance.background(255);
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.