function call, inner loop
JavaScript performance comparison
Info
Testing/profiling the code patterns from the Script Junkie article "(pre)Maturely Optimize Your JavaScript"
http://msdn.microsoft.com/en-us/scriptjunkie/gg622887.aspx
Snippet comparison #1
Preparation code
<script>
function isOdd(num) {
return (num % 2 == 1);
}
var num_odds, nums, i;
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
function, inner loop |
|
pending… |
no function, no inner loop |
|
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 Kyle Simpson
- Revision 2: published by Rick Waldron
- Revision 3: published by Kyle Simpson
- Revision 4: published
0 comments