Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
URL vs String
(version: 1)
Comparing performance of:
URL String vs URL SearchParams
Created:
one year ago
by:
Guest
Jump to the latest result
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()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
URL String
URL SearchParams
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
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/OS:
Chrome 135 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
URL String
1846184.9 Ops/sec
URL SearchParams
621459.6 Ops/sec
Related benchmarks:
empty object
Random Name
destructuring X undefined X null X delete X new reference
Token Data
destructuring vs creating
array.join vs string literal
pick by substring key fixed
pick by substring key and concatenate
Comparing response.json() and JSON.parse(response.text())
Comments
Confirm delete:
Do you really want to delete benchmark?