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
Rotates images using different canvas js tools.
<script>
var catpicdata = "http://www.goodboydigital.com/wp-content/uploads/2013/01/goodboy_logo.png";
</script>
<!-- KineticJS -->
<div id="kinContainer" style="width: 200px; height: 200px;">
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/kineticjs/5.0.1/kinetic.min.js">
</script>
<!-- EaselJS -->
<canvas id="easCanvas" width="200" height="200">
</canvas>
<script src="http://code.createjs.com/createjs-2013.09.25.min.js">
</script>
<!-- Collie -->
<script src="http://jindo.dev.naver.com/collie/deploy/collie.min.js"></script>
<div id="colContainer"></div>
<!-- pixi.js -->
<script src="http://www.goodboydigital.com/pixijs/bunnymark/js/pixi.js">
</script>
<div id="pixiContainer"></div>
<canvas id="pixiContainerCanvas" width=200 height=200></canvas>
<!-- cgengine -->
<script src="http://176.10.116.50/cgengine.min.js"></script>
<canvas id="cgengineContainer" width=200 height=200></canvas>
<script>
// **** KineticJS **** //
var kinStage = new Kinetic.Stage({
container: 'kinContainer',
width: 200,
height: 200
});
var kinLayer = new Kinetic.Layer();
var kinImage = new Image();
kinImage.src = catpicdata;
var kinLogo;
kinImage.onload = function() {
kinLogo = new Kinetic.Image({
x: 100,
y: 62,
image: kinImage,
width: 200,
height: 125,
offset: [100, 62]
});
// add the shape to the layer
kinLayer.add(kinLogo);
// add the layer to the stage
kinStage.add(kinLayer);
}
// **** EaselJS **** //
var easStage = new createjs.Stage('easCanvas');
var easLogo = new createjs.Bitmap(catpicdata);
easLogo.set({
x: 100,
y: 62,
regX: 100,
regY: 62
});
easStage.addChild(easLogo);
easStage.update();
// **** Collie **** //
var colLayer = new collie.Layer({
width: 200,
height: 200
});
collie.ImageManager.add({
logo: catpicdata
});
var colLogo = new collie.MovableObject({
x: 0,
y: 0,
backgroundImage: "logo",
originX: 100,
originY: 62
}).addTo(colLayer);
collie.Renderer.addLayer(colLayer);
collie.Renderer.load(document.getElementById("colContainer"));
// **** pixi.js **** //
var pixiStage = new PIXI.Stage(0xFFFFFF);
var pixiRenderer = PIXI.autoDetectRenderer(200, 200);
document.getElementById('pixiContainer').appendChild(pixiRenderer.view);
var pixiTexture = PIXI.Texture.fromImage(catpicdata);
var pixiLogo = new PIXI.Sprite(pixiTexture);
pixiLogo.anchor.x = 0.5;
pixiLogo.anchor.y = 0.5;
pixiLogo.position.x = 100;
pixiLogo.position.y = 62;
pixiStage.addChild(pixiLogo);
// **** pixi.js canvas **** //
var pixiStageCanvas = new PIXI.Stage(0xFFFFFF);
var pixiRendererCanvas = new PIXI.CanvasRenderer(200, 200, document.getElementById('pixiContainerCanvas'));
var pixiTextureCanvas = PIXI.Texture.fromImage(catpicdata);
var pixiLogoCanvas = new PIXI.Sprite(pixiTextureCanvas);
pixiLogoCanvas.anchor.x = 0.5;
pixiLogoCanvas.anchor.y = 0.5;
pixiLogoCanvas.position.x = 100;
pixiLogoCanvas.position.y = 62;
pixiStageCanvas.addChild(pixiLogoCanvas);
var cgEngineStage = new CGEngine.Graphic.Stage(document.getElementById("cgengineContainer"));
var image = new Image();
var cgEngineSprite = null;
image.src = catpicdata;
image.onload = function() {
cgEngineSprite = new CGEngine.Graphic.Sprite(image);
cgEngineSprite.regX = 100;
cgEngineSprite.regY = 62;
cgEngineSprite.addToStage(cgEngineStage);
cgEngineSprite.setIsChanged();
cgEngineStage.draw();
}
// **** Init **** //
setTimeout(function() {
kinLayer.drawScene();
easStage.update();
collie.Renderer.draw();
pixiRenderer.render(pixiStage);
pixiRendererCanvas.render(pixiStageCanvas);
}, 1000);
</script>
var i = 0;
Ready to run.
Test | Ops/sec | |
---|---|---|
KineticJS |
| ready |
EaselJS |
| ready |
Collie |
| ready |
Pixi.js (WebGL if supported) |
| ready |
Pixi.js Canvas render |
| ready |
CGEngine canvas render |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.