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

Output json optimizations #2436

Merged
merged 5 commits into from
Mar 16, 2022
Merged

Output json optimizations #2436

merged 5 commits into from
Mar 16, 2022

Commits on Mar 11, 2022

  1. output/json: Add benchmarks

    mstoykov committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    481c9ba View commit details
    Browse the repository at this point in the history
  2. output/json: Add bufio.Writer

    No changes in benchmarks but still a good idea.
    
    Likely the gzip package has enough of a buffer for this to not matter in
    this case
    mstoykov committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    51298aa View commit details
    Browse the repository at this point in the history
  3. output/json: use easyjson almost 40% faster

    name            old time/op    new time/op    delta
    FlushMetrics-8    37.6ms ±11%    23.2ms ±12%  -38.41%  (p=0.000 n=10+10)
    
    name            old alloc/op   new alloc/op   delta
    FlushMetrics-8    2.44MB ± 1%    2.52MB ± 0%   +3.54%  (p=0.000 n=10+10)
    
    name            old allocs/op  new allocs/op  delta
    FlushMetrics-8     47.2k ± 1%     20.1k ± 0%  -57.47%  (p=0.000 n=10+10)
    mstoykov committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    cdb3f83 View commit details
    Browse the repository at this point in the history
  4. output/json: use klauspost gzip for another 20% improvement

    name            old time/op    new time/op    delta
    FlushMetrics-8    23.2ms ±12%    18.2ms ± 6%  -21.31%  (p=0.000 n=10+9)
    
    name            old alloc/op   new alloc/op   delta
    FlushMetrics-8    2.52MB ± 0%    2.52MB ± 0%     ~     (p=0.324 n=10+10)
    
    name            old allocs/op  new allocs/op  delta
    FlushMetrics-8     20.1k ± 0%     20.1k ± 0%     ~     (all equal)
    mstoykov committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    5f0e09b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5ebbb96 View commit details
    Browse the repository at this point in the history