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
<script src="//popcornjs.org/code/dist/popcorn.js"></script>
<video id="subject" src="http://dl.dropbox.com/u/3531958/snowdriving.ogv"></video>
<script>
Popcorn.addTrackEventAlt = function(obj, track) {
if (track._natives) {
// Supports user defined track event id
track._id = !track.id ? Popcorn.guid(track._natives.type) : track.id;
// Push track event ids into the history
obj.data.history.push(track._id);
track._natives.start = track._natives.start || Popcorn.nop;
track._natives.end = track._natives.end || Popcorn.nop;
}
track.start = Popcorn.util.toSeconds(track.start, obj.options.framerate);
track.end = Popcorn.util.toSeconds(track.end, obj.options.framerate);
//console.log( obj.data.trackEvents.byStart );
// Store this definition in an array sorted by times
//obj.data.trackEvents.byStart.push( track );
//obj.data.trackEvents.byEnd.push( track );
var byStart = obj.data.trackEvents.byStart,
byEnd = obj.data.trackEvents.byEnd;
for (var idx = byStart.length - 1; idx >= 0; idx--) {
//console.log( track.start, byStart[ idx ].start );
if (track.start >= byStart[idx].start) {
obj.data.trackEvents.byStart.splice(idx + 1, 0, track);
break;
}
}
for (var idx = byEnd.length - 1; idx >= 0; idx--) {
//console.log( track.start, byStart[ idx ].start );
if (track.start >= byEnd[idx].start) {
obj.data.trackEvents.byEnd.splice(idx + 1, 0, track);
break;
}
}
};
Popcorn.prototype.execAlt = function(time, fn) {
// Creating a one second track event with an empty end
Popcorn.addTrackEventAlt(this, {
start: time,
end: time + 1,
_running: false,
_natives: {
start: fn || Popcorn.nop,
end: Popcorn.nop,
type: "exec"
}
});
return this;
};
var $current = Popcorn("#subject")
$alt = Popcorn("#subject");
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
current |
| ready |
alt |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.