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 tx out compacting #2553

Merged
merged 3 commits into from
Nov 19, 2021
Merged

Improve tx out compacting #2553

merged 3 commits into from
Nov 19, 2021

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Nov 16, 2021

After some investigation I found out why we didn't get as much as expected on the compacting TxOut. It turns out constraints on data types do not come for free. Dropping those constraints in favor of couple impossible error calls we regain the expected savings on the TxOut:

  Case                                             Max          MaxOS           Live        Allocated      GCs  Wall Time
  IntMap (KeyMap TxId TxOut) (original)  1,185,790,008  3,191,865,344  1,194,345,304  199,779,514,568  176,472   398.977s
  IntMap (KeyMap TxId TxOut)             1,185,789,440  3,132,096,512  1,194,344,248  174,999,006,728  163,813   366.926s
  IntMap (KeyMap TxId TxOut) (sharing)   1,063,937,144  2,557,476,864  1,072,490,464  180,082,957,552  168,734   356.143s
  IntMap (KeyMap TxId TxOut')            1,163,115,976  3,128,950,784  1,171,668,776  182,641,648,320  171,162   337.480s
  IntMap (KeyMap TxId TxOut') (sharing)  1,041,263,648  2,487,222,272  1,049,814,984  189,083,461,088  177,386   334.723s

Legend:

Only this commit is important in this PR: 3da6065 the rest are changes to the benchmarking tool that were needed for getting this problem figured out.

```
  Case                                             Max          MaxOS           Live        Allocated      GCs  Wall Time
  IntMap (KeyMap TxId TxOut) (original)  1,185,790,008  3,191,865,344  1,194,345,304  199,779,514,568  176,472   398.977s
  IntMap (KeyMap TxId TxOut)             1,185,789,440  3,132,096,512  1,194,344,248  174,999,006,728  163,813   366.926s
  IntMap (KeyMap TxId TxOut) (sharing)   1,063,937,144  2,557,476,864  1,072,490,464  180,082,957,552  168,734   356.143s
  IntMap (KeyMap TxId TxOut')            1,163,115,976  3,128,950,784  1,171,668,776  182,641,648,320  171,162   337.480s
  IntMap (KeyMap TxId TxOut') (sharing)  1,041,263,648  2,487,222,272  1,049,814,984  189,083,461,088  177,386   334.723s
```
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @lehins !

@lehins lehins merged commit 45e4026 into master Nov 19, 2021
@iohk-bors iohk-bors bot deleted the lehins/improve-tx-out-compacting branch November 19, 2021 01:42
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.

3 participants