Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JSON.stringify vs structuredClone (7 KB JSON)
(version: 0)
JSON.stringify vs structuredClone
Comparing performance of:
JSON.stringify vs structuredClone
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var MyObject = { "testJSON": [ { "id": 0, "name": "Elijah", "city": "Austin", "age": 78, "friends": [ { "name": "Michelle", "hobbies": [ "Watching Sports", "Reading", "Skiing & Snowboarding" ] }, { "name": "Robert", "hobbies": [ "Traveling", "Video Games" ] } ] }, { "id": 1, "name": "Noah", "city": "Boston", "age": 97, "friends": [ { "name": "Oliver", "hobbies": [ "Watching Sports", "Skiing & Snowboarding", "Collecting" ] }, { "name": "Olivia", "hobbies": [ "Running", "Music", "Woodworking" ] }, { "name": "Robert", "hobbies": [ "Woodworking", "Calligraphy", "Genealogy" ] }, { "name": "Ava", "hobbies": [ "Walking", "Church Activities" ] }, { "name": "Michael", "hobbies": [ "Music", "Church Activities" ] }, { "name": "Michael", "hobbies": [ "Martial Arts", "Painting", "Jewelry Making" ] } ] }, { "id": 2, "name": "Evy", "city": "San Diego", "age": 48, "friends": [ { "name": "Joe", "hobbies": [ "Reading", "Volunteer Work" ] }, { "name": "Joe", "hobbies": [ "Genealogy", "Golf" ] }, { "name": "Oliver", "hobbies": [ "Collecting", "Writing", "Bicycling" ] }, { "name": "Liam", "hobbies": [ "Church Activities", "Jewelry Making" ] }, { "name": "Amelia", "hobbies": [ "Calligraphy", "Dancing" ] } ] }, { "id": 3, "name": "Oliver", "city": "St. Louis", "age": 39, "friends": [ { "name": "Mateo", "hobbies": [ "Watching Sports", "Gardening" ] }, { "name": "Nora", "hobbies": [ "Traveling", "Team Sports" ] }, { "name": "Ava", "hobbies": [ "Church Activities", "Running" ] }, { "name": "Amelia", "hobbies": [ "Gardening", "Board Games", "Watching Sports" ] }, { "name": "Leo", "hobbies": [ "Martial Arts", "Video Games", "Reading" ] } ] }, { "id": 4, "name": "Michael", "city": "St. Louis", "age": 95, "friends": [ { "name": "Mateo", "hobbies": [ "Movie Watching", "Collecting" ] }, { "name": "Chris", "hobbies": [ "Housework", "Bicycling", "Collecting" ] } ] }, { "id": 5, "name": "Michael", "city": "Portland", "age": 19, "friends": [ { "name": "Jack", "hobbies": [ "Painting", "Television" ] }, { "name": "Oliver", "hobbies": [ "Walking", "Watching Sports", "Movie Watching" ] }, { "name": "Charlotte", "hobbies": [ "Podcasts", "Jewelry Making" ] }, { "name": "Elijah", "hobbies": [ "Eating Out", "Painting" ] } ] }, { "id": 6, "name": "Lucas", "city": "Austin", "age": 76, "friends": [ { "name": "John", "hobbies": [ "Genealogy", "Cooking" ] }, { "name": "John", "hobbies": [ "Socializing", "Yoga" ] } ] }, { "id": 7, "name": "Michelle", "city": "San Antonio", "age": 25, "friends": [ { "name": "Jack", "hobbies": [ "Music", "Golf" ] }, { "name": "Daniel", "hobbies": [ "Socializing", "Housework", "Walking" ] }, { "name": "Robert", "hobbies": [ "Collecting", "Walking" ] }, { "name": "Nora", "hobbies": [ "Painting", "Church Activities" ] }, { "name": "Mia", "hobbies": [ "Running", "Painting" ] } ] }, { "id": 8, "name": "Emily", "city": "Austin", "age": 61, "friends": [ { "name": "Nora", "hobbies": [ "Bicycling", "Skiing & Snowboarding", "Watching Sports" ] }, { "name": "Ava", "hobbies": [ "Writing", "Reading", "Collecting" ] }, { "name": "Amelia", "hobbies": [ "Eating Out", "Watching Sports" ] }, { "name": "Daniel", "hobbies": [ "Skiing & Snowboarding", "Martial Arts", "Writing" ] }, { "name": "Zoey", "hobbies": [ "Board Games", "Tennis" ] } ] }, { "id": 9, "name": "Liam", "city": "New Orleans", "age": 33, "friends": [ { "name": "Chloe", "hobbies": [ "Traveling", "Bicycling", "Shopping" ] }, { "name": "Evy", "hobbies": [ "Eating Out", "Watching Sports" ] }, { "name": "Grace", "hobbies": [ "Jewelry Making", "Yoga", "Podcasts" ] } ] } ] } var myCopy = null;
Tests:
JSON.stringify
myCopy = JSON.parse(JSON.stringify(MyObject));
structuredClone
myCopy = structuredClone(MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
JSON.stringify
structuredClone
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/126.0.0.0 Whale/3.27.254.15 Safari/537.36
Browser/OS:
Chrome 126 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
JSON.stringify
50987.1 Ops/sec
structuredClone
22911.5 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It seems like you're trying to provide some information about benchmarks, but the format is not clear. Here's my attempt to break it down and answer your question: You have three JSON objects: `MyObject`, which contains a list of friends with their hobbies; `myCopy`, which is supposed to be the result of serializing (or cloning) `MyObject`; and some benchmark results. The benchmark results show two tests: 1. "JSON.stringify" with a high number of executions per second (50987.05859375). 2. "structuredClone" with a lower number of executions per second (22911.53125). To answer your question, it appears that the test you are interested in is the one comparing `JSON.stringify` and `structuredClone`. However, without more context or information about what these benchmarks are measuring, it's difficult to provide a definitive answer. Can you please clarify what you would like to know or ask based on this benchmark result?
Related benchmarks:
Lodash.isEqual vs JSON.stringify Equality Comparison for Medium Deep Object.
json stringify vs string...ssss
JSON parse vs structuredClone | longer json
structuredClose(myObject) vs JSON.parse(JSON.stringify(myObject))
Comments
Confirm delete:
Do you really want to delete benchmark?