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

fix: Use bitfield.MultiMerge to improve LoadSectorState performance #1086

Merged
merged 3 commits into from
Nov 7, 2022

Conversation

birdychang
Copy link
Contributor

Using bitfield.MultiMerge once instead of bitfield.MergeBitFields repeatedly should reduce the time by 50%.

@birdychang birdychang changed the title Improve LoadSectorState performance. Improve LoadSectorState performance Nov 4, 2022
@birdychang birdychang requested review from frrist and placer14 November 4, 2022 08:13
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2022

Codecov Report

Merging #1086 (493e6ac) into master (85faa23) will decrease coverage by 0.1%.
The diff coverage is 0.0%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1086     +/-   ##
========================================
- Coverage    34.3%   34.2%   -0.2%     
========================================
  Files          44      44             
  Lines        2932    2945     +13     
========================================
  Hits         1008    1008             
- Misses       1828    1841     +13     
  Partials       96      96             

func LoadSectorState(ctx context.Context, state miner.State) (*SectorStates, error) {
_, span := otel.Tracer("").Start(ctx, "LoadSectorState")
defer span.End()

sectorStates := &SectorStates{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sectorStates := &SectorStates{}


return nil
})
}); err != nil {
return nil, err
}
var err error
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var err error
var err error
var sectorStates = &SectorStates{}

@placer14
Copy link
Contributor

placer14 commented Nov 7, 2022

Great initial contribution! 🙇

@placer14 placer14 changed the title Improve LoadSectorState performance fix: Use bitfield.MultiMerge to improve LoadSectorState performance Nov 7, 2022
@birdychang birdychang merged commit 2ae8b1a into master Nov 7, 2022
@birdychang birdychang deleted the birdy/improve-load-sector-state branch November 7, 2022 22:59
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