Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Uint8Array vs Uint8ClampedArray 4 value copy
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser:
Chrome 127
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Uint8Array
6030.0 Ops/sec
Uint8ClampedArray
6060.0 Ops/sec
Script Preparation code:
var arr1 = new Uint8Array(2500); var arr2 = new Uint8ClampedArray(2500);
Tests:
Uint8Array
for(let i = 0; i < 2500; i += 4) { let next = (i + 4) % 2500; arr1[i] = arr1[next]; arr1[i+1] = arr1[next+1]; arr1[i+2] = arr1[next+2]; arr1[i+3] = arr1[next+3]; } arr1[37] = arr1[732]
Uint8ClampedArray
for(let i = 0; i < 2500; i += 4) { let next = (i + 4) % 2500; arr2[i] = arr2[next]; arr2[i+1] = arr2[next+1]; arr2[i+2] = arr2[next+2]; arr2[i+3] = arr2[next+3]; } arr2[37] = arr2[732]