|
Ran
|
Jobs
3
|
Files
143
|
Run time
1min
|
Badge
README BADGES
|
push
github
clvm-utils: memoize atom hashes in TreeCache (#1562) * clvm-utils: memoize re-used long atoms in TreeCache tree_hash_cached memoized pairs seen more than once but re-hashed atoms on every reference. A tree like (L (L (L ...))), with one long atom L referenced from many distinct pairs, re-hashed L once per pair, which is quadratic in the input size. Track heap atoms the same way as pairs: a parallel `atoms` Vec indexed by atom index, with the same NOT_VISITED / SEEN_ONCE / SEEN_MULTIPLE sentinels. visit_tree marks atoms of 55 bytes or more (shorter ones hash in a single SHA-256 block), and an atom seen at least twice has its hash stored on first compute and reused after. Hashes are unchanged. * clvm-utils: merge visit_atom into TreeCache::visit visit() now tracks pairs and heap atoms of ATOM_MEMOIZE_THRESHOLD bytes or more, and returns true only for a pair on its first visit. visit_tree routes the root and both children through it, so a long atom passed as the root is tracked too and gets memoized across repeated tree_hash_cached calls sharing a cache. * clvm-utils: should_memoize is true only for SEEN_MULTIPLE A slot below SEEN_MULTIPLE is an index into hashes, i.e. already memoized, so it is no longer a candidate. tree_hash_cached only asks after get() has returned None, so its behavior is unchanged. --------- (cherry picked from commit 44b325c76)
97 of 97 new or added lines in 1 file covered. (100.0%)
17295 of 21026 relevant lines covered (82.26%)
11544305.53 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | Linux release Cargo - 42015213492.1 | 141 |
75.16
|
GitHub Action Run | |
| 2 | Linux dev Cargo - 42015213492.2 | 141 |
72.86
|
GitHub Action Run | |
| 3 | Linux release pytest - 42015213492.3 | 117 |
59.58
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|