https://github.com/timluq/structured-clone-binary
Pure JS implementation of a Structured Clone Algorithm to/from an ArrayBuffer.
https://github.com/timluq/structured-clone-binary
Last synced: 29 days ago
JSON representation
Pure JS implementation of a Structured Clone Algorithm to/from an ArrayBuffer.
- Host: GitHub
- URL: https://github.com/timluq/structured-clone-binary
- Owner: TimLuq
- Created: 2017-08-20T22:25:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T23:40:17.000Z (almost 9 years ago)
- Last Synced: 2025-01-12T06:26:01.455Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pure JS implementation of a Structured Clone Algorithm to/from an ArrayBuffer.
Right now its performance is significantly lower than that of native JSON serialization.
My basic test cases show, in Node.js v8.4, somewhere around 30-40 times the execution time for repeated serialization as compared to `JSON.stringify`.
Deserialization is almost as bad at around 10-20 times the execution time of `JSON.parse` in my test case.
If large objects are referred to multiple times I expect this balance to shift, though I'm not sure if that is common in real-world cases.
Byte length of the serialized data, read "through the wire", is about 33% of unpretty-JSON in my test case.