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>
var rdashAlpha = /-([a-z]|[0-9])/ig,
rdashAlpha2 = /^-(?=ms)|-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function(all, letter) {
return (letter + "").toUpperCase();
},
fcamelCase2 = function(all, letter) {
return letter ? (letter + "").toUpperCase() : "";
};
function origCamel(string) {
return string.replace(rdashAlpha, fcamelCase);
}
function camelDave(string) {
return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
}
function camelGnarf(string) {
return string.replace(rdashAlpha2, fcamelCase2);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
original |
| ready |
camelDave |
| ready |
camelGnarf |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.