chakra-core / chakra-core/ChakraCore
perf: JSON.stringify Array performance
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
`fast-json-stringify` benchmark results as of #3894
```
Chakra: JSON.stringify array x 1,685 ops/sec ±4.13% (77 runs sampled)
v8: JSON.stringify array x 3,421 ops/sec ±0.64% (92 runs sampled)
Chakra: JSON.stringify long string x 30,920 ops/sec ±0.46% (92 runs sampled)
v8: JSON.stringify long string x 14,839 ops/sec ±0.20% (94 runs sampled)
Chakra: JSON.stringify short string x 5,585,836 ops/sec ±3.49% (77 runs sampled)
v8 : JSON.stringify short string x 4,586,806 ops/sec ±0.36% (90 runs sampled)
Chakra: JSON.stringify obj x 1,518,252 ops/sec ±3.22% (81 runs sampled)
v8: JSON.stringify obj x 1,604,359 ops/sec ±0.75% (94 runs sampled)
```
**JSON.stringify of Array needs some attention.**
**P.S.** when I run the benchmarks under v8 powered node.js, `fast-json-stringify` was outperforming v8 significantly. However, when I run the benchmarks under chakracore powered node.js, `fast-json-stringify` wasn't performing good. This is possibly due to engine specific optimizations made there. In order not to compare apples to oranges, I kept the numbers for `fast-jason-stringify` aside.
Contributor guide
Research direction
Start by reproducing the reported JSON.stringify array benchmark in ChakraCore-powered Node.js and compare it with the V8 result. Investigate the array-specific JSON.stringify path; done means materially improved array performance with benchmark results confirming the change without regressing the other reported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100