Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
URL vs String
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/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
URL String
1846184.9 Ops/sec
URL SearchParams
621459.6 Ops/sec
Script Preparation code:
const test1 = () => { const baseUrl = "https://www.measurethat.net"; const params = { id: 4, benchmark: 5832 }; const queryString = Object.entries(params) .map(([key, value]) => `${key}=${value}`) .join("&"); const fullUrl = new URL(`${baseUrl}?${queryString}`) } const test2 = ()=>{ const url = new URL("https://www.measurethat.net"); const params = { id: 4, benchmark: 5832 }; for (const [key, value] of Object.entries(params)) { url.searchParams.append(key, value); } }
Tests:
URL String
test1()
URL SearchParams
test2()