Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringify stats using streaming approach #2190

Merged
merged 1 commit into from Dec 7, 2020
Merged

Stringify stats using streaming approach #2190

merged 1 commit into from Dec 7, 2020

Commits on Dec 5, 2020

  1. 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).
    lahmatiy committed Dec 5, 2020
    Copy the full SHA
    9b5d04e View commit details
    Browse the repository at this point in the history