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

Compression + Storage Optimization #113

Merged
merged 7 commits into from
Aug 22, 2020
Merged

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Aug 21, 2020

This PR introduces a few storage optimizations that significantly improve the performance of the entire storage package in the real world. Many of these optimizations were performed while working on rosetta-bitcoin (soon to be released).

The most noticeable change is that all data saved to disk is now first compressed by https://github.com/facebook/zstd.

Warning

This PR changes how all data is stored. You will need to delete any previously saved data when upgrading.

Future PR

Make it easy for users to train a zstd dictionary to further increase compression ratio (on small data, has been shown to 4-8x compression ratio): https://github.com/facebook/zstd#the-case-for-small-data-compression

@patrick-ogrady patrick-ogrady changed the title Storage Optimization Compression + Storage Optimization Aug 21, 2020
@coveralls
Copy link

coveralls commented Aug 21, 2020

Pull Request Test Coverage Report for Build 4754

  • 154 of 182 (84.62%) changed or added relevant lines in 7 files are covered.
  • 151 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.02%) to 77.033%

Changes Missing Coverage Covered Lines Changed/Added Lines %
storage/balance_storage.go 1 2 50.0%
storage/badger_storage.go 21 23 91.3%
storage/coin_storage.go 24 27 88.89%
storage/utils.go 10 16 62.5%
storage/block_storage.go 96 112 85.71%
Files with Coverage Reduction New Missed Lines %
reconciler/reconciler.go 1 84.18%
storage/block_storage.go 3 69.53%
constructor/worker.go 19 85.61%
storage/coin_storage.go 26 72.73%
utils/utils.go 44 51.35%
fetcher/construction.go 58 0%
Totals Coverage Status
Change from base Build 4644: -0.02%
Covered Lines: 4102
Relevant Lines: 5325

💛 - Coveralls

@patrick-ogrady patrick-ogrady requested review from juliankoh, qiwu7, yfl92 and a team August 21, 2020 23:21
@patrick-ogrady patrick-ogrady requested a review from yfl92 August 22, 2020 00:52
Copy link

@yfl92 yfl92 left a comment

Choose a reason for hiding this comment

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

LGTM

@patrick-ogrady patrick-ogrady merged commit bfec6e6 into master Aug 22, 2020
@patrick-ogrady patrick-ogrady deleted the patrick/storage-stats branch August 22, 2020 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants