-
Notifications
You must be signed in to change notification settings - Fork 71
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
[OCC] if no txs, avoid scheduler overhead, limit tasks #468
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## seiv2 #468 +/- ##
=======================================
Coverage 55.35% 55.35%
=======================================
Files 629 629
Lines 53884 53883 -1
=======================================
+ Hits 29826 29828 +2
+ Misses 21924 21922 -2
+ Partials 2134 2133 -1
|
if err != nil { | ||
// TODO: handle error | ||
} | ||
|
||
responses := make([]*sdk.DeliverTxResult, 0, len(req.TxEntries)) |
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.
is it safe to create a slice with capacity 0? i think its probably fine but just checking
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.
yes it's safe (just didn't want it to be nil for marshaling reasons, which would be idiomatic golang)
baseapp/abci.go
Outdated
for _, tx := range txRes { | ||
responses = append(responses, &sdk.DeliverTxResult{Response: tx}) | ||
// avoid overhead for empty batches | ||
if len(req.TxEntries) > 0 { |
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.
nit: slight preference for defensive checks with early return as opposed to nested ifs
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.
good point - that's idiomatic golang
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
## Describe your changes and provide context - avoids scheduler if no txs (mainly for gassless situations) - limits tasks to the min(task count, workers) ## Testing performed to validate your change - unit tests and load testing
Describe your changes and provide context
Testing performed to validate your change