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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
/**
* Node From String Function
* @author Kyle Foster
* @license MIT
*/
var nodeFromString = function( string ) {
var match = /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/.exec( string ),
tag = match[ 1 ],
content = match[ 3 ],
unwrap = true,
node = document.createElement( tag ),
outliers = [ 'legend', 'area', 'param', 'thead', 'tr', 'col', 'td' ];
for ( var i = 0; i < outliers.length; i++ ) {
if ( tag === outliers[ i ] ) { unwrap = false; }
}
if ( unwrap ) {
node.innerHTML = string;
return node.firstChild;
} else {
node.innerHTML = content;
return node;
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Node From String Function |
| ready |
jQuery Function |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.