Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stringify stats using streaming approach
Change the approach for stats stringify to use streams instead of JSON.stringify() + sync write. No API or functionality is changed. It makes stats available for huge projects. Changes has the follow effects: Memory Allows to avoid max string length limit of V8 engine (500MB). In other words, stats becomes available for huge projects, whose stats exceed 500MB. Reduces memory consumption on serialization. Adds time penalty. However, this make sense for huge stats only and seems to be an acceptable, given that otherwise stats may be unavailable (due max string limit hit or out of memory). Adds new dependency "json-ext", which is dependency free and most effective solution for a huge JSON parse/stringify at the moment, and other solutions have troubles to handle huge JSON (see https://github.com/discoveryjs/json-ext/blob/master/benchmarks/README.md#stream-stringifying).
- Loading branch information