Skip to content

Conversation

zliu41
Copy link
Member

@zliu41 zliu41 commented Sep 18, 2025

The memory usage of Values are updated to include a factor of max key length in the Value.

@zliu41 zliu41 requested review from Unisay, kwxm, effectfully, ana-pantilie and a team September 18, 2025 19:57
@zliu41 zliu41 added the No Changelog Required Add this to skip the Changelog Check label Sep 18, 2025
Copy link
Contributor

PR Preview Action v1.6.2

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/pr-7349/

Built to branch gh-pages at 2025-09-18 19:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

. fromInteger
. uncurry (*)
. (toInteger . Value.totalSize &&& toInteger . (+1) . Value.maxKeyLength)
. unValueTotalSize
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: at this point I'd just use a where or a let.

-- | Like `pack` but does not normalize.
pack' :: NestedMap -> Value
pack' (normalize -> v) = Value v sizes size
pack' (normalize -> v) = Value v sizes lens size
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment says it doesn't normalize, but it does normalize.

( IntMap.alter (maybe (Just 1) (Just . (+ 1))) (Map.size inner) ss
, IntMap.unionWith
(+)
(IntMap.alter (maybe (Just 1) (Just . (+ 1))) (B.length currency) ls)
Copy link
Contributor

Choose a reason for hiding this comment

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

This IntMap.alter <...> pattern occurs a lot, give it a general name like incOne or whatever (and use that instead of incLen)?

@zliu41 zliu41 merged commit b2a5de1 into master Sep 21, 2025
1 of 2 checks passed
@zliu41 zliu41 deleted the zliu41/value-key-sizes branch September 21, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants