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

[OCC] if no txs, avoid scheduler overhead, limit tasks #468

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

stevenlanders
Copy link
Contributor

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

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 55.35%. Comparing base (c8a64b5) to head (c1c02b0).

Additional details and impacted files

Impacted file tree graph

@@           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     
Files Coverage Δ
tasks/scheduler.go 90.59% <100.00%> (+0.80%) ⬆️
baseapp/abci.go 51.62% <70.00%> (-0.06%) ⬇️

if err != nil {
// TODO: handle error
}

responses := make([]*sdk.DeliverTxResult, 0, len(req.TxEntries))
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

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

Copy link
Contributor Author

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

@stevenlanders stevenlanders merged commit e946bfb into seiv2 Mar 20, 2024
13 checks passed
@stevenlanders stevenlanders deleted the handle-low-tx-sets-for-perf branch March 20, 2024 19:05
udpatil pushed a commit that referenced this pull request Mar 26, 2024
## 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
udpatil pushed a commit that referenced this pull request Mar 26, 2024
## 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
udpatil pushed a commit that referenced this pull request Mar 27, 2024
## 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
udpatil pushed a commit that referenced this pull request Apr 16, 2024
## 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
udpatil pushed a commit that referenced this pull request Apr 19, 2024
## 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
udpatil pushed a commit that referenced this pull request Apr 19, 2024
## 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
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.

3 participants