Skip to content

Comments

Drop update round state routine#34

Draft
abi87 wants to merge 1 commit intobera-v1.xfrom
drop_updateRoundStateRoutine
Draft

Drop update round state routine#34
abi87 wants to merge 1 commit intobera-v1.xfrom
drop_updateRoundStateRoutine

Conversation

@abi87
Copy link

@abi87 abi87 commented Sep 17, 2025


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Drop update round state routine". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat
 - fix
 - build
 - chore
 - ci
 - docs
 - refactor
 - perf
 - test
 - revert
 - spec
 - merge

General format: type(scope): msg
Breaking change: type(scope)!: msg
Multi-scope change: type: msg
Types: feat, fix, build, chore, ci, docs, refactor, perf, test, revert, spec, merge.
Example: fix(cmd/cometbft/commands/debug): execute p.Signal only when p is not nil

@abi87 abi87 changed the base branch from v1.x-bera to bera-v1.x September 17, 2025 10:51
Comment on lines -564 to -576
func (conR *Reactor) updateRoundStateRoutine() {
t := time.NewTicker(100 * time.Microsecond)
defer t.Stop()
for range t.C {
if !conR.IsRunning() {
return
}
rs := conR.conS.GetRoundState()
conR.rsMtx.Lock()
conR.rs = rs
conR.rsMtx.Unlock()
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loops does very frequent and short lived allocations.
Can it be replaced with just a get over round state wherever is necessary?
This is what this PR tries and do

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.

1 participant