Conversion to octet
JavaScript performance comparison
Info
What's the fastest way to convert any value to an octet?
Preparation code
<script>
Benchmark.prototype.setup = function() {
window.input = (-5+10*Math.random()) | 0;
window.output = 0;
window.data = new DataView(new ArrayBuffer(1));
window.tarr = new Uint8Array(1);
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Code conversion |
|
pending… |
DataView conversion |
|
pending… |
Uint8Array conversion |
|
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 FremyCompany
- Revision 2: published
0 comments