JSON parse JSON stringify speed test
See original GitHub issueHow does the speed of this compare to using JSON.parse(JSON.stringify(obj)) === JSON.parse(JSON.stringify(obj2))
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Can JSON.parse() performance be improvement? - ITNEXT
const objD = JSON.parse(JSON.stringify(objA));. If you test how long it would take to copy 1⁰⁹ object using those methods you get results like...
Read more >Performance of JSON Parse/Stringify - Stack Overflow
From my tests in Chrome JSON.stringify will be much faster than Array.join - but when parsing it, String.split seems to be faster.
Read more >Benchmark: JSON Stringify Speed Test - MeasureThat.net
JSON Stringify Speed Test (version: 0). This benchmark tests whether the speed or JSON.stringify changes with object size. Comparing performance of: 1 vs...
Read more >Why JSON.parse(JSON.stringify()) is a bad practice to clone ...
The JSON.stringify() just converts a JavaScript value to a JSON string. It`s ok to use it with some primitives like Numbers, Strings or...
Read more >60fps Javascript while you stringify, parse, process, compress ...
TL;DR I've created async versions of JSON stringify and parse plus a whole ... performance is massively impacted by our perception of speed....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After looking into it, this comparison actually fits better in the fast-deep-equal repo. A
JSON.stringify(obj1) === JSON.stringify(obj2)
comparison cannot handle circular references and should never be used when data might contain React components. It’s also pretty slow when running generic data, as well as susceptible to giving false positives in many other cases.@SashaKoro agreed. And thanks for posting the results- that’s really interesting!