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

appender: add initial set of benches #2128

Merged
merged 4 commits into from
May 23, 2022

Conversation

bryangarza
Copy link
Member

This patch adds blocking and nonblocking benchmarks. This code is from
an old PR (#703) that was never merged, and now ported to TOT so that it
compiles.

Co-authored-by: Zeki Sherif 9832640+zekisherif@users.noreply.github.com

This patch adds blocking and nonblocking benchmarks. This code is from
an old PR (tokio-rs#703) that was never merged, and now ported to TOT so that it
compiles.

Co-authored-by: Zeki Sherif <9832640+zekisherif@users.noreply.github.com>
@bryangarza bryangarza requested a review from a team as a code owner May 16, 2022 22:43
@davidbarsky
Copy link
Member

Ran the benchmarks locally:

synchronous/single_thread
                        time:   [260.34 ns 261.33 ns 262.32 ns]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
synchronous/multiple_writers
                        time:   [434.49 ns 439.19 ns 443.70 ns]

non_blocking/single_thread
                        time:   [359.14 ns 361.87 ns 365.46 ns]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) low mild
  6 (6.00%) high mild
  3 (3.00%) high severe
non_blocking/multiple_writers
                        time:   [449.06 ns 453.83 ns 460.30 ns]
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) high mild
  15 (15.00%) high severe

@davidbarsky
Copy link
Member

davidbarsky commented May 17, 2022

Ran these benchmarks on a slower, but less noisy, VM. Under the theory that the writers here where benchmarking the allocator more than tracing-appender, I've made the writers de-facto no-ops; returning only the length of the buffer to the caller. There are the results:

synchronous/single_thread
                        time:   [615.81 ns 621.69 ns 627.45 ns]
                        change: [-12.844% -11.995% -11.171%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
synchronous/multiple_writers
                        time:   [723.88 ns 736.01 ns 750.46 ns]
                        change: [-36.285% -33.383% -30.748%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe

non_blocking/single_thread
                        time:   [916.12 ns 925.63 ns 935.11 ns]
                        change: [-5.6573% -4.8139% -4.0233%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
non_blocking/multiple_writers
                        time:   [1.0901 us 1.1054 us 1.1226 us]
                        change: [-58.656% -35.543% -10.128%] (p = 0.18 > 0.05)
                        No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe

(The prior run was the PR's existing contents.)

I'll flamegraph these benchmarks to confirm that it's allocator overhead, but I suspect that we'd want to change the writers to return only the buffer size to measure just tracing-appender.

@bryangarza
Copy link
Member Author

Thanks. I need to look at why the Netlify build is failing...

@davidbarsky
Copy link
Member

same reason it was failing in Tokio: tokio-rs/tokio#4699 (comment). I'll fix this.

@bryangarza bryangarza merged commit b2cd503 into tokio-rs:master May 23, 2022
@bryangarza bryangarza deleted the zekisherif/appender-benches branch May 23, 2022 16:06
hawkw pushed a commit that referenced this pull request Jun 6, 2022
* appender: add initial set of benches

This patch adds blocking and nonblocking benchmarks. This code is from
an old PR (#703) that was never merged, and now ported to TOT so that it
compiles.

Co-authored-by: Zeki Sherif <9832640+zekisherif@users.noreply.github.com>

* switch to no-op writers in benchmarks

* fix macro resolution issue

Co-authored-by: Zeki Sherif <9832640+zekisherif@users.noreply.github.com>
Co-authored-by: David Barsky <me@davidbarsky.com>
hawkw pushed a commit that referenced this pull request Jun 7, 2022
* appender: add initial set of benches

This patch adds blocking and nonblocking benchmarks. This code is from
an old PR (#703) that was never merged, and now ported to TOT so that it
compiles.

Co-authored-by: Zeki Sherif <9832640+zekisherif@users.noreply.github.com>

* switch to no-op writers in benchmarks

* fix macro resolution issue

Co-authored-by: Zeki Sherif <9832640+zekisherif@users.noreply.github.com>
Co-authored-by: David Barsky <me@davidbarsky.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants