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

fix: performance regression in_span #1492

Merged
merged 2 commits into from
Aug 15, 2023
Merged

fix: performance regression in_span #1492

merged 2 commits into from
Aug 15, 2023

Conversation

robertlaurin
Copy link
Contributor

@robertlaurin robertlaurin commented Jul 17, 2023

https://github.com/fastruby/fast-ruby/blob/main/code/proc-and-block/proc-call-vs-yield.rb

ruby proc-call-vs-yield.rb
Warming up --------------------------------------
          block.call     1.141M i/100ms
       block + yield     1.202M i/100ms
        unused block     1.495M i/100ms
               yield     1.389M i/100ms
Calculating -------------------------------------
          block.call     11.485M (± 1.4%) i/s -     58.175M in   5.066280s
       block + yield     11.910M (± 1.6%) i/s -     60.089M in   5.046587s
        unused block     14.945M (± 5.4%) i/s -     74.725M in   5.019902s
               yield     14.068M (± 1.0%) i/s -     70.858M in   5.037486s

Comparison:
        unused block: 14945101.0 i/s
               yield: 14067574.6 i/s - same-ish: difference falls within error
       block + yield: 11910103.8 i/s - 1.25x  slower
          block.call: 11485071.3 i/s - 1.30x  slower

Edit: to add this was with ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

We'll probably want to update the linters here https://github.com/open-telemetry/opentelemetry-ruby/pull/1323/files#diff-17159f63bf877cf73b9013894bea9311fb40cd7a4af890df4b0c77ba9fe2828b

@arielvalentin
Copy link
Contributor

Anyone working on core have any insights into what the cause of the latency is in these execution paths?

Are the Rubocop maintainers aware?

@robertlaurin robertlaurin merged commit d003724 into main Aug 15, 2023
46 checks passed
@robertlaurin robertlaurin deleted the fix-perf-regression branch August 15, 2023 16:40
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

3 participants