-
Notifications
You must be signed in to change notification settings - Fork 490
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
chore: use string builder instead of string concatenation in catchup service #5572
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5572 +/- ##
==========================================
- Coverage 55.79% 55.77% -0.02%
==========================================
Files 446 446
Lines 63418 63420 +2
==========================================
- Hits 35381 35371 -10
- Misses 25668 25678 +10
- Partials 2369 2371 +2
... and 13 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@bbroder-algo @winder can you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the contribution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no forks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see the whole s
defined in one piece using backticks to avoid all the double quotes, the escaping, and concatenation altogether.
@@ -744,17 +745,19 @@ func (s *Service) fetchRound(cert agreement.Certificate, verifier *agreement.Asy | |||
if cert.Round == fetchedCert.Round && | |||
cert.Proposal.BlockDigest != fetchedCert.Proposal.BlockDigest && | |||
fetchedCert.Authenticate(*block, s.ledger, verifier) == nil { | |||
s := "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the test for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, I ran it in go playground and it worked.
BenchmarkPlusEq-8 1515818 779.0 ns/op |
Summary
hello Algorand team
I replaced string concatenation with a builder, that's faster and more efficient, concatenation with
+
is also too expensive.