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 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 15
Operating system:
iOS 15.5
Device Platform:
Mobile
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
object
19.7M/s
domrect
7.2M/s
View exact numbers
Test name
Executions per second
✓
object
19,672,562 Ops/sec
domrect
7,222,031 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)