function vs. no function
JavaScript performance comparison
Info
I Wanted to check, how bad the performance of a function is compared to using no function
Preparation code
<script>
function inv(i) {
if (i == 0) {
return 1;
} else {
return 0;
}
}
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Function |
|
pending… |
No Function |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Martin Schlagnitweit
- Revision 2: published
- Revision 3: published by gnur
- Revision 4: published
0 comments