Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
jQuery width vs computed style
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
native
1.8M/s
jquery
382K/s
View exact numbers
Test name
Executions per second
✓
native
1,791,072 Ops/sec
jquery
381,925 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script> <style> #wrap { width:5rem; height: 3rem; margin:10px; padding:10px; border:10px solid black; } </style> <div id="wrap1"> </div>
Script Preparation code:
var $div = $("#wrap1"); var div = document.getElementById("wrap1");
Tests:
jquery
const width = $div.width();
native
const width = parseInt(getComputedStyle(div, '').width);