Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
spread or push long array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 125
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
spread
32807.2 Ops/sec
push
39595.8 Ops/sec
Tests:
spread
const nodes = [ {id: 1, graphKey: 'key1'}, {id: 9, graphKey: 'key9'}, {id: 3, graphKey: 'key3'}, {id: 4, graphKey: 'key4'}, {id: 5, graphKey: 'key5'}, {id: 6, graphKey: 'key5'}, {id: 7, graphKey: 'key5'}, {id: 8, graphKey: 'key5'}, {id: 10, graphKey: 'key5'}, {id: 11, graphKey: 'key5'}, {id: 12, graphKey: 'key5'}, {id: 13, graphKey: 'key5'}, {id: 14, graphKey: 'key5'}, {id: 15, graphKey: 'key5'}, {id: 16, graphKey: 'key5'}, {id: 17, graphKey: 'key5'}, ] const selected = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] const selectedNodeIds = selected.reduce((result, currentSelected) => { const node = nodes.find((n) => n.id === currentSelected); return node ? [...result, node.graphKey] : result; }, []) console.log(selectedNodeIds);
push
const nodes = [ {id: 1, graphKey: 'key1'}, {id: 9, graphKey: 'key9'}, {id: 3, graphKey: 'key3'}, {id: 4, graphKey: 'key4'}, {id: 5, graphKey: 'key5'}, {id: 6, graphKey: 'key5'}, {id: 7, graphKey: 'key5'}, {id: 8, graphKey: 'key5'}, {id: 10, graphKey: 'key5'}, {id: 11, graphKey: 'key5'}, {id: 12, graphKey: 'key5'}, {id: 13, graphKey: 'key5'}, {id: 14, graphKey: 'key5'}, {id: 15, graphKey: 'key5'}, {id: 16, graphKey: 'key5'}, {id: 17, graphKey: 'key5'}, ] const selected = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] const selectedNodeIds = selected.reduce((result, currentSelected) => { const node = nodes.find((n) => n.id === currentSelected); if (node) { result.push(node.graphKey) } return result; }, []) console.log(selectedNodeIds);