Skip to content

Commit

Permalink
Merge pull request #525 from etclabscore/dev/pprof-cpu
Browse files Browse the repository at this point in the history
[WIP] fix high CPU use
  • Loading branch information
meowsbits authored Feb 6, 2023
2 parents 995294b + 474e418 commit bbda084
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions core/tx_cacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,9 @@ func newTxSenderCacher(threads int) *txSenderCacher {
// cache is an infinite loop, caching transaction senders from various forms of
// data structures.
func (cacher *txSenderCacher) cache() {
for {
select {
case task := <-cacher.tasks:
for i := 0; i < len(task.txs); i += task.inc {
types.Sender(task.signer, task.txs[i])
}
default:
if cacher.tasks == nil {
return
}
for task := range cacher.tasks {
for i := 0; i < len(task.txs); i += task.inc {
types.Sender(task.signer, task.txs[i])
}
}
}
Expand Down

0 comments on commit bbda084

Please sign in to comment.