Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Native XHR vs XHR 2
Pure JavaScript XHR Benchmark
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Native XHR
34149.8 Ops/sec
Native XHR (enhanced)
33931.9 Ops/sec
Native XHR 2
31680.6 Ops/sec
Fetch
26243.6 Ops/sec
Script Preparation code:
function showResult(data) { //console.log(data); } var newUrl = "https://www.googleapis.com/discovery/v1/apis";
Tests:
Native XHR
var xhr = new XMLHttpRequest(); xhr.open("GET", newUrl, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { showResult(xhr); } } xhr.send();
Native XHR (enhanced)
var xhr = new XMLHttpRequest(); xhr.open("GET", newUrl, true); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { showResult(xhr); } } xhr.send();
Native XHR 2
var xhr = new XMLHttpRequest(); xhr.onload = showResult; xhr.open("GET", newUrl, true); xhr.send();
Fetch
var request = fetch(newUrl).then(showResult);