Pow2
JavaScript performance comparison
Preparation code
<script>
var high = Math.pow(2,50);
var rx = /^10*$/;
function isPow2rx(x){return (rx.test(x.toString(2)));}
function isPow2bi(x){return !(x&x-1) && x>0}
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
RegEx
|
|
pending… |
Bin-High
|
|
pending… |
RegEx-High
|
|
pending… |
Bin
|
|
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.
- Revision 1: published @thurmda
- Revision 2: published Calvin Metcalf
- Revision 3: published Calvin
- Revision 4: published
0 Comments