Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
domrect vs object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Browser:
Chrome 96
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
object
17.3M/s
domrect
2.9M/s
View exact numbers
Test name
Executions per second
✓
object
17,283,554 Ops/sec
domrect
2,885,750 Ops/sec
HTML Preparation code:
<div id='test'></div>
Script Preparation code:
function createCanvasRect( x, y, width, height ) { const top = height >= 0 ? y : y + height; const right = width >= 0 ? x + width : x; const bottom = height >= 0 ? y + height : y; const left = width >= 0 ? x : x + width; return { x, y, width, height, top, right, bottom, left, }; }
Tests:
domrect
new DOMRect(1,2,3,4)
object
createCanvasRect(1,2,3,4)