beam icon indicating copy to clipboard operation
beam copied to clipboard

[BEAM-13015, #21250] Remove looking up thread local metrics container holder and object creation on hot path

Open lukecwik opened this issue 3 years ago • 2 comments

This got rid of about half of the overhead of activating the metrics container for the current thread.

The updated implementation is about 48 ms for the two calls to activate: 82i2zKaRgVrKaqW

While the existing implementation is 75 ms (+8 ms not shown for the Closeable#close invocation): BK4ZarAWCoVzXZj


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [ ] Choose reviewer(s) and mention them in a comment (R: @username).
  • [ ] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • [ ] Update CHANGES.md with noteworthy changes.
  • [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels Python tests Java tests Go tests

See CI.md for more information about GitHub Actions CI.

lukecwik avatar Aug 08 '22 21:08 lukecwik

R: @steveniemitz

lukecwik avatar Aug 09 '22 02:08 lukecwik

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

github-actions[bot] avatar Aug 09 '22 02:08 github-actions[bot]

sorry I was OOO last week, I'll take a look at this today!

steveniemitz avatar Aug 15 '22 11:08 steveniemitz

No, worries. Hopefully you had a good vacation.

lukecwik avatar Aug 15 '22 17:08 lukecwik

No, worries. Hopefully you had a good vacation.

I did, thank you!

this looks good to me, always great to get rid of static state as well.

steveniemitz avatar Aug 16 '22 15:08 steveniemitz