Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Unique Instance Test
Unique Instance Test
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Windows
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
Standard Instance
286.7 Ops/sec
Unique Instance by key
224.6 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const N = 1<<16; const getInt = (()=>{r=Math.random;f=Math.floor;return (a=0,b=0x100000000)=>f(r()*(b-a))+a})(); const getStr = (()=>{ const f = (n)=> n < 10 ? 0x30 + n : n < 36 ? 0x41 + (n - 10) : 0x61 + (n - 36); return (n)=> String.fromCharCode(...(new Int32Array(n)).map(()=>f(getInt(0,62)))); })(); const createInstance = (str)=>{ return { str, val : getInt() }; }
Tests:
Standard Instance
let list = new Array(N); const getInstance = (value)=>createInstance(value) for(i=0;i<N;i++) list[i] = getInstance(getStr(1));
Unique Instance by key
let list = new Array(N); let refs = {}; const getInstance = (value)=>{ if(refs[value]) return refs[value]; return refs[value] = createInstance(value); } for(i=0;i<N;i++) list[i] = getInstance(getStr(1));