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 angular.copy vs lodash.clone (v14) Revision 14 of this benchmark created on March 3, 2015 Preparation HTML <script src ="//rawgithub.com/lodash/lodash/3.3.1/dist/lodash.min.js" > </script >
<script src ="//ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js" > </script >
Setup var obj_to_clone = {
'@timestamp' : '2011-10-10T10:20:90' ,
host : 'some.host.name' ,
source : 'some.source' ,
level : 'undefined' ,
severity : 0 ,
trace : Math .floor (Math .random ()* 1e12 ).toString (36 )
};
var len = 10000 ;
Test runner Ready to run.
Run Quick Run Testing in WebKit 537.36 / undefined Test Ops/sec angular.copy for (var i = 0 ; i < len; ++i) {
var clone_obj = angular.copy (obj_to_clone);
}
ready
lodash.clone for (var i = 0 ; i < len; ++i) {
var clone_obj = _.clone (obj_to_clone, true );
}
ready
lodash.cloneDeep for (var i = 0 ; i < len; ++i) {
var clone_obj = _.cloneDeep (obj_to_clone);
}
ready
JSON.parse(JSON.stringify()) for (var i = 0 ; i < len; ++i) {
var clone_obj = JSON .parse (JSON .stringify (obj_to_clone));
}
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published on October 29, 2013 Revision 3 : published on January 12, 2014 Revision 4 : published on January 16, 2014 Revision 5 : published on January 16, 2014 Revision 6 : published on April 25, 2014 Revision 7 : published by Sander on May 3, 2014 Revision 8 : published on June 13, 2014 Revision 9 : published on November 21, 2014 Revision 10 : published by zagazeg on November 26, 2014 Revision 11 : published by sergei on January 20, 2015 Revision 12 : published by BenL on February 3, 2015 Revision 14 : published on March 3, 2015 Revision 15 : published on March 3, 2015 Revision 16 : published on March 4, 2015 Revision 17 : published on March 12, 2015 Revision 18 : published by Money Mike on April 3, 2015 Revision 19 : published on April 13, 2015 Revision 21 : published on April 25, 2015 Revision 22 : published by Danny on May 5, 2015 Revision 23 : published by Danny on May 5, 2015 Revision 24 : published by kalamarico on May 13, 2015