Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JSON vs splits text
(version: 1)
Comparing performance of:
Json vs Text
Created:
9 months ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; const dataArray = []; for (let i = 0; i < 1000; i++) { const subArray = []; const numSubparts = Math.floor(Math.random() * 5) + 1; for (let j = 0; j < numSubparts; j++) { const len = Math.floor(Math.random() * 100) + 1; let str = ''; for (let k = 0; k < len; k++) { str += chars[Math.floor(Math.random() * chars.length)]; } subArray.push(str); } dataArray.push(subArray); } // Format 1: JSON string const jsonData = JSON.stringify(dataArray); // Format 2: Double-delimited string const splitData = dataArray.map(arr => arr.join(';')).join(',');
Tests:
Json
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ JSON.parse(jsonData)
Text
splitData.split(',').map(p => p.split(';'))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Json
Text
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/129.0.6668.69 Mobile/15E148 Safari/604.1
Browser/OS:
Chrome Mobile iOS 129 on iOS 18.6
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Json
8151.1 Ops/sec
Text
9319.1 Ops/sec
Related benchmarks:
Lodash _.some vs _.includes vs array.find
IndexOf vs Includes vs lodash includes vs dictionary with large array
Better set.has vs array.includes
reduce: spreading acc vs mutating acc
concat vs spread vs push
Object.values() vs Array.from(Map.values())
javascript case insensitive compare with -1 0 1 for sorting
lodash difference with long strings
JS string split fix Len
Comments
Confirm delete:
Do you really want to delete benchmark?