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

perf(tm2/bft/fail): use sync.Once instead of Getenv on each call #2805

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

thehowl
Copy link
Member

@thehowl thehowl commented Sep 16, 2024

minor change spotted when browsing tm2 code.

fail.Fail is called a lot in hot paths, like in the tm2 state machine. This avoids calling os.Getenv each time, which actually does a bunch of stuff, even when there is no associated env var.

@thehowl thehowl self-assigned this Sep 16, 2024
@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.86%. Comparing base (5503cca) to head (78ed413).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
tm2/pkg/bft/fail/fail.go 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2805      +/-   ##
==========================================
+ Coverage   60.83%   60.86%   +0.03%     
==========================================
  Files         563      563              
  Lines       75193    75190       -3     
==========================================
+ Hits        45743    45765      +22     
+ Misses      26076    26058      -18     
+ Partials     3374     3367       -7     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
gno.land 67.17% <ø> (ø)
gnovm 65.63% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (-0.36%) ⬇️
tm2 62.08% <60.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thehowl thehowl merged commit 6f3a094 into master Sep 18, 2024
120 checks passed
@thehowl thehowl deleted the dev/morgan/bft-fail-once branch September 18, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants