onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
39 stars 16 forks source link

Limit number of goroutines in FastCommit() #268

Closed SaveTheRbtz closed 2 years ago

SaveTheRbtz commented 2 years ago

Partially improves: #267

Description

Currently, PersistentSlabStorage.FastCommit() creates goroutines during runtime.

This may be a bit inefficient in cases where there is a small number of keys and a high number of CPUs. For now, simply upper-bound the number of goroutines by the number keys.


codecov-commenter commented 2 years ago

Codecov Report

Merging #268 (f439666) into main (525fbc2) will decrease coverage by 0.02%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
- Coverage   68.98%   68.95%   -0.03%     
==========================================
  Files          14       14              
  Lines        7257     7260       +3     
==========================================
  Hits         5006     5006              
- Misses       1619     1621       +2     
- Partials      632      633       +1     
Impacted Files Coverage Δ
storage.go 79.13% <0.00%> (-0.42%) :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 525fbc2...f439666. Read the comment docs.