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 block propagation performance #879

Merged
merged 7 commits into from
May 27, 2020

Conversation

longfin
Copy link
Member

@longfin longfin commented May 23, 2020

This PR addresses #871. I've benchmarked via Libplanet.Benchmark. (it tests a scenario using 10 skewed Swarm<T>s.)

Before

|                    Method |    Mean |    Error |   StdDev |  Median |
|-------------------------- |--------:|---------:|---------:|--------:|
|            BroadcastBlock | 1.202 s | 0.0341 s | 0.1005 s | 1.198 s |
| BroadcastBlockWithoutFill | 1.110 s | 0.0277 s | 0.0816 s | 1.131 s |

After

|                    Method |     Mean |    Error |   StdDev |
|-------------------------- |---------:|---------:|---------:|
|            BroadcastBlock | 820.2 ms | 20.15 ms | 57.18 ms |
| BroadcastBlockWithoutFill | 652.8 ms | 20.38 ms | 58.81 ms |

@longfin longfin self-assigned this May 23, 2020
@codecov
Copy link

codecov bot commented May 23, 2020

Codecov Report

Merging #879 into master will decrease coverage by 0.25%.
The diff coverage is 70.27%.

@@            Coverage Diff             @@
##           master     #879      +/-   ##
==========================================
- Coverage   87.49%   87.24%   -0.26%     
==========================================
  Files         251      247       -4     
  Lines       22917    22229     -688     
==========================================
- Hits        20052    19393     -659     
+ Misses       1525     1505      -20     
+ Partials     1340     1331       -9     
Impacted Files Coverage Δ
Libplanet/Net/NetMQTransport.cs 84.00% <68.57%> (+0.15%) ⬆️
Libplanet/Net/Swarm.cs 85.54% <100.00%> (+0.05%) ⬆️
Libplanet/FixedSizedQueue.cs 81.25% <0.00%> (-18.75%) ⬇️
Libplanet/Blocks/BlockDigest.cs 76.31% <0.00%> (-10.53%) ⬇️
Libplanet.RocksDBStore.Tests/RocksDBStoreTest.cs
Libplanet.RocksDBStore/RocksDBStore.cs
Libplanet.RocksDBStore/RocksDBStoreBitConverter.cs
...ibplanet.RocksDBStore.Tests/RocksDBStoreFixture.cs
Libplanet/Net/Protocols/KademliaProtocol.cs 65.01% <0.00%> (+0.38%) ⬆️

@longfin longfin linked an issue May 23, 2020 that may be closed by this pull request
@longfin longfin changed the title [WIP] Improve block propagation performance Improve block propagation performance May 23, 2020
@longfin longfin marked this pull request as ready for review May 23, 2020 17:01
CHANGES.md Outdated Show resolved Hide resolved
Libplanet/Net/NetMQTransport.cs Outdated Show resolved Hide resolved
Libplanet/Net/NetMQTransport.cs Outdated Show resolved Hide resolved
@longfin longfin added the network Related to networking (Libplanet.Net) label May 25, 2020
@longfin longfin merged commit 488dffd into planetarium:master May 27, 2020
@longfin longfin mentioned this pull request May 27, 2020
longfin added a commit that referenced this pull request May 27, 2020
* Strip task

* Reduce wating time

* Skip reply listening when we don't need

* Adopt fire-and-shot for broadcasting

* Remove unnecessary delaying

* fixup [skip changelog]

This content had been already reflected on master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Related to networking (Libplanet.Net)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block propagation is too slow
5 participants