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
I'm creating a simple function that is going to be run as a kernel to generate an array of samples from multiple input arrays.
So for example out[x] = in1[x] + in2[x] repeated from [0..n]
Because these combinations can be fairly complex, I wanted a dynamic way of building the kernel. In the process I've discovered that while IE and Firefox seem to JIT compile this kernel, chrome does not.
Why?
eval("function eval_add(in_1, in_2){return (in_1 + in_2);};")
func_add = new Function("in_1", "in_2", "return (in_1 + in_2);")
function real_add(in_1, in_2){return (in_1 + in_2);};
Ready to run.
Test | Ops/sec | |
---|---|---|
Eval Add |
| ready |
Func Add |
| ready |
Real Add |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.