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

Improve performance of BlockSet<T> #1013

Merged
merged 5 commits into from
Sep 23, 2020

Conversation

longfin
Copy link
Member

@longfin longfin commented Sep 22, 2020

This PR adds a cache to BlockSet<T> to improve its fetching performance. (it can be useful when blocks contain huge and complex actions.)

@longfin longfin self-assigned this Sep 22, 2020
@longfin longfin marked this pull request as ready for review September 22, 2020 14:19
moreal
moreal previously approved these changes Sep 22, 2020
@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #1013 into main will decrease coverage by 0.15%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
- Coverage   89.00%   88.84%   -0.16%     
==========================================
  Files         330      330              
  Lines       29897    29918      +21     
==========================================
- Hits        26609    26580      -29     
- Misses       1717     1765      +48     
- Partials     1571     1573       +2     
Impacted Files Coverage Δ
Libplanet/Blockchain/BlockChain.cs 90.65% <ø> (ø)
Libplanet/Store/BlockSet.cs 81.66% <ø> (-0.39%) ⬇️
Libplanet/Net/Swarm.cs 84.20% <0.00%> (-2.40%) ⬇️
Libplanet/Store/DefaultStore.cs 85.69% <0.00%> (-0.96%) ⬇️
Libplanet/Net/BlockCompletion.cs 94.18% <0.00%> (-0.88%) ⬇️
Libplanet.Tests/Net/SwarmTest.Preload.cs 98.52% <0.00%> (-0.33%) ⬇️
Libplanet/Net/NetMQTransport.cs 82.37% <0.00%> (-0.13%) ⬇️

moreal
moreal previously approved these changes Sep 22, 2020
earlbread
earlbread previously approved these changes Sep 23, 2020
@longfin longfin dismissed stale reviews from earlbread and moreal via 178ada1 September 23, 2020 02:50
Libplanet/Store/BlockSet.cs Outdated Show resolved Hide resolved
@azure-pipelines
Copy link
Contributor

There was an error handling pipeline event 1419a0be-8d39-45de-a9fb-53f57bffac73.

earlbread
earlbread previously approved these changes Sep 23, 2020
moreal
moreal previously approved these changes Sep 23, 2020
riemannulus
riemannulus previously approved these changes Sep 23, 2020
Libplanet/Store/BlockSet.cs Outdated Show resolved Hide resolved
@longfin longfin dismissed stale reviews from riemannulus, moreal, and earlbread via 9545d57 September 23, 2020 04:34
Copy link
Contributor

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

It's the last turn.

CHANGES.md Outdated Show resolved Hide resolved
Co-authored-by: Hong Minhee (洪 民憙) <hong.minhee@gmail.com>
@limebell
Copy link
Member

limebell commented Sep 23, 2020

I guess 178ada1 can be reverted for the performance as 9545d57 c6795ff removes caches everytime.

@longfin
Copy link
Member Author

longfin commented Sep 23, 2020

I guess 178ada1 can be reverted for the performance as 9545d57 c6795ff removes caches everytime.

c6795ff can cover many cases but it still can't in some cases that users tried to delete a block using IStore.DeleteBlock() directly...

@longfin longfin merged commit 63048cc into planetarium:main Sep 23, 2020
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.

6 participants