Buckets:
| const Benchmark = require('benchmark') | |
| const sjson = require('..') | |
| const internals = { | |
| text: '{ "a": 5, "b": 6, "__proto__": { "x": 7 }, "c": { "d": 0, "e": "text", "__proto__": { "y": 8 }, "f": { "g": 2 } } }' | |
| } | |
| const suite = new Benchmark.Suite() | |
| suite | |
| .add('JSON.parse', () => { | |
| JSON.parse(internals.text) | |
| }) | |
| .add('secure-json-parse parse', () => { | |
| sjson.parse(internals.text, { protoAction: 'ignore' }) | |
| }) | |
| .add('secure-json-parse safeParse', () => { | |
| sjson.safeParse(internals.text) | |
| }) | |
| .add('reviver', () => { | |
| JSON.parse(internals.text, internals.reviver) | |
| }) | |
| .on('cycle', (event) => { | |
| console.log(String(event.target)) | |
| }) | |
| .on('complete', function () { | |
| console.log('Fastest is ' + this.filter('fastest').map('name')) | |
| }) | |
| .run({ async: true }) | |
| internals.reviver = function (_key, value) { | |
| return value | |
| } | |
Xet Storage Details
- Size:
- 876 Bytes
- Xet hash:
- a8ed14076035f7b7a0fbb7bcb5ad8a9afaf3ac7e18c38ecf83e6cb80ed9eee79
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.