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
See here: http://www.reddit.com/r/programming/comments/buosj/addanumbertoanothernumberinjavascriptimg/?sort=top
<script src="http://code.jquery.com/jquery-1.6.min.js"></script>
<div id="result1">
<script>
(function($) {
$.fn.extend({
// $(...).number( num )
// Save the number 'num' in the jQuery data
// for the selected element(s), and return 'this'
// for chaining.
// $(...).number()
// Return the number stored in the jQuery data
// for the selected elements(s).
number: function(num) {
if (arguments.length == 0) return this.data('number');
this.data('number', num);
return this;
},
// $(...).add( num )
// Add the number 'num' to the number stored
// in the jQuery data for the selected element(s)
add: function(num) {
return this.number(this.number() + num);
},
// $(...).subtract( num )
// Subtract the number 'num' from the number stored
// in the jQuery data for the selected element(s)
subtract: function(num) {
return this.number(this.number() - num);
}
});
})(jQuery);
var result2;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
jquery |
| ready |
pure js |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.