Fantom-foundation / go-lachesis

aBFT consensus for permission-less networks
https://fantom.foundation
MIT License
223 stars 78 forks source link

Feature 2765 fast stoch peer selection #487

Closed devintegral2 closed 4 years ago

devintegral2 commented 4 years ago

RouletteAS is implemented there as StochasticPermutation function and compared with WeightedPermutation function. Unfortunately, it is 10 times slowly, so is not used.

$ go test -bench=. -benchmem ./utils
Benchmark_StochasticPermutation-3           8097            135945 ns/op           19876 B/op        308 allocs/op
Benchmark_WeightedPermutation-3            97062             11415 ns/op            2014 B/op         27 allocs/op
codecov-commenter commented 4 years ago

Codecov Report

Merging #487 into develop will decrease coverage by 0.01%. The diff coverage is 78.78%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #487      +/-   ##
===========================================
- Coverage    47.56%   47.55%   -0.02%     
===========================================
  Files          189      191       +2     
  Lines        13812    13855      +43     
===========================================
+ Hits          6570     6589      +19     
- Misses        6670     6689      +19     
- Partials       572      577       +5     
Impacted Files Coverage Δ
utils/weighted_shuffle.go 93.75% <ø> (+4.65%) :arrow_up:
utils/permutation.go 76.47% <76.47%> (ø)
utils/roulette.go 81.25% <81.25%> (ø)
inter/ascii_scheme.go 80.50% <0.00%> (-2.83%) :arrow_down:
evmcore/tx_pool.go 74.70% <0.00%> (-0.53%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ec1e3b2...35980a7. Read the comment docs.