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

Performance regression between v0.20.0 and master #784

Open
igorwwwwwwwwwwwwwwwwwwww opened this issue Jan 28, 2025 · 0 comments
Open

Performance regression between v0.20.0 and master #784

igorwwwwwwwwwwwwwwwwwwww opened this issue Jan 28, 2025 · 0 comments

Comments

@igorwwwwwwwwwwwwwwwwwwww

I ran into this while debugging an other mystery. Master at the time of writing is 923f51b. I tested this on Apple M1 hardware.

It appears that one of the recent changes has had a considerable performance impact, it is reproducible with the cpp benchmarks.

$ for i in v0.20.0 master; do git checkout $i; go build -o jsonnet-$i ./cmd/jsonnet; done

$ hyperfine --warmup 3 --parameter-list binary './jsonnet-v0.20.0,./jsonnet-master' '{binary} cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000'

Benchmark #1: ./jsonnet-v0.20.0 cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000
  Time (mean ± σ):     201.7 ms ±   3.8 ms    [User: 169.0 ms, System: 46.8 ms]
  Range (min … max):   196.3 ms … 208.5 ms    13 runs

Benchmark #2: ./jsonnet-master cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000
  Time (mean ± σ):     290.9 ms ±   2.3 ms    [User: 239.1 ms, System: 71.4 ms]
  Range (min … max):   287.6 ms … 294.1 ms    10 runs

Summary
  './jsonnet-v0.20.0 cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000' ran
    1.44 ± 0.03 times faster than './jsonnet-master cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000'

Profiling:

$ for i in v0.20.0 master; do JSONNET_CPU_PROFILE=cpu-$i.pprof ./jsonnet-$i cpp-jsonnet/benchmarks/bench.07.jsonnet --max-stack 1000000; go tool pprof -svg -output cpu-$i.pprof.svg cpu-$i.pprof; done

These are short-lived runs, so I'm not sure how accurate the profiles are.

I also noticed during a larger build that jsonnet-master was using 3.5 cores, whereas jsonnet-v0.20.0 only used a single core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant