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

eskip: add BenchmarkJsonUnmarshal #2876

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Jan 19, 2024

Add a benchmark of unmarshalling 10000 routes from JSON and compare its performance to eskip parsing.

This establishes a baseline for future optimizations.

$ benchstat -col .name <(go test ./eskip -run=NONE -bench='BenchmarkJsonUnmarshal|BenchmarkParse$' -count=10)
goos: linux
goarch: amd64
pkg: github.com/zalando/skipper/eskip
    │    Parse    │             JsonUnmarshal              │
    │   sec/op    │    sec/op      vs base                 │
*-8   247.1m ± 1%   1281.4m ± 16%  +418.51% (p=0.000 n=10)

    │    Parse     │            JsonUnmarshal            │
    │     B/op     │     B/op      vs base               │
*-8   49.02Mi ± 0%   46.54Mi ± 0%  -5.06% (p=0.000 n=10)

    │    Parse    │            JsonUnmarshal            │
    │  allocs/op  │  allocs/op   vs base                │
*-8   1.080M ± 0%   1.420M ± 0%  +31.48% (p=0.000 n=10)

@AlexanderYastrebov AlexanderYastrebov added minor no risk changes, for example new filters performance labels Jan 19, 2024
Add a benchmark of unmarshalling 10000 routes from JSON and
compare its performance to eskip parsing.

This establishes a baseline for future optimizations.

```
$ benchstat -col .name <(go test ./eskip -run=NONE -bench='BenchmarkJsonUnmarshal|BenchmarkParse$' -count=10)
goos: linux
goarch: amd64
pkg: github.com/zalando/skipper/eskip
    │    Parse    │             JsonUnmarshal              │
    │   sec/op    │    sec/op      vs base                 │
*-8   247.1m ± 1%   1281.4m ± 16%  +418.51% (p=0.000 n=10)

    │    Parse     │            JsonUnmarshal            │
    │     B/op     │     B/op      vs base               │
*-8   49.02Mi ± 0%   46.54Mi ± 0%  -5.06% (p=0.000 n=10)

    │    Parse    │            JsonUnmarshal            │
    │  allocs/op  │  allocs/op   vs base                │
*-8   1.080M ± 0%   1.420M ± 0%  +31.48% (p=0.000 n=10)
```

Signed-off-by: Alexander Yastrebov <[email protected]>
@szuecs
Copy link
Member

szuecs commented Jan 19, 2024

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit acacf3e into master Jan 19, 2024
14 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the eskip/benchmark-json-unmarshal branch January 19, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor no risk changes, for example new filters performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants