Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
normalize / trim text
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
no
162368.8 Ops/sec
normalize
131490.6 Ops/sec
trim
152345.6 Ops/sec
both 1
117893.8 Ops/sec
both 2
113671.8 Ops/sec
Script Preparation code:
function makeid(length) { let result = ''; const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 '; const charactersLength = characters.length; let counter = 0; while (counter < length) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); counter += 1; } return result; } var data = Array(10000).fill(Array(40).fill(makeid(1000))) var rows = [] var row = {}
Tests:
no
data.forEach((items) => {items.forEach((item,i)=>{row[i] = item}); rows.push(row)})
normalize
data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.normalize()}); rows.push(row)})
trim
data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.trim()}); rows.push(row)})
both 1
data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.normalize().trim()}); rows.push(row)})
both 2
data.forEach((items) => {items.forEach((item,i)=>{row[i] = item.trim().normalize()}); rows.push(row)})