Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Integer variable vs integer in a single-element array
Trying to avoid int/float conversion
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Linux
Device Platform:
Desktop
Date tested:
7 months ago
raw2
167.5M/s
ArrayBuf
162.0M/s
Array int
150.5M/s
Raw int
76.2M/s
View exact numbers
Test name
Executions per second
✓
raw2
167,473,760 Ops/sec
ArrayBuf
162,041,696 Ops/sec
Array int
150,485,168 Ops/sec
Raw int
76,249,936 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
class Ints { #raw = 0 #arr = [0] #buf = new Uint32Array([0]) incrementRaw() { ++this.#raw; } incrementRaw2() { this.#raw = (this.#raw|0)+1; } incrementArr() { ++this.#arr[0]; } incrementBuf() { ++this.#buf[0]; } } globalThis.i = new Ints();
Tests:
Raw int
globalThis.i.incrementRaw();
Array int
globalThis.i.incrementArr();
ArrayBuf
globalThis.i.incrementBuf();
raw2
globalThis.i.incrementRaw2();