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
this is kind of wtf, since referring to arguments.callee is always going to refer to the current function, whereas this.constructor is going to refer to the .constructor property of "this" (whatever that may be)... I don't mean to imply that they are equivalent actions... and it is well-known that "arguments.callee" is deprecated and slow.
Update: Added the third case. Not equivalent this.constructor, but fyi it is more or less equivalent to saying "arguments.callee" (and faster). I guess the only time you might actually "need" arguments.callee is for recursion in an anonymous function (hint: give the function an identifier).
<script>
function Foo(){
arguments.callee;
}
function Bar(){
this.constructor;
}
function Baz(){
Baz;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
arguments.callee |
| ready |
this.constructor |
| ready |
just refer to the damn thing by name |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.