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

Prune list iterators #3574

Merged
merged 5 commits into from
Feb 24, 2021
Merged

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Feb 23, 2021

We want to merge #3576 and #3575 before we merge this.
Likely to be some conflicts as I pulled those changes out as separate PRs.


Lets us do the following -

  let bitmap: Bitmap = prune_list
    .unpruned_leaf_iter(cutoff_pos)
    .collect();

Which is a really convenient way of producing a bitmap representing unpruned leaf positions based on a prune_list.
This in effect "inverts" the prune_list giving the leaves that remain after pruning.

We can take advantage of this for more efficient pruning/compaction.

It is possible to efficiently compute the difference between what was pruned last time and what needs to be pruned this time -

20210224 09:17:13.613 DEBUG grin_store::pmmr - ***** prev_leaf_bitmap: 209732
20210224 09:17:13.616 DEBUG grin_store::pmmr - ***** next_leaf_bitmap: 196498
20210224 09:17:13.616 DEBUG grin_store::pmmr - ***** diff between bitmaps: 15467

@antiochp antiochp marked this pull request as ready for review February 24, 2021 12:29
@antiochp antiochp force-pushed the prune_list_unpruned_iter branch from 1d64943 to 8cd8a48 Compare February 24, 2021 16:25
@antiochp antiochp merged commit 3583028 into mimblewimble:master Feb 24, 2021
@antiochp antiochp deleted the prune_list_unpruned_iter branch February 24, 2021 17:02
@antiochp antiochp mentioned this pull request May 6, 2021
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.

1 participant