Skip to content

Conversation

@samcamwilliams
Copy link
Collaborator

This change moves our position in an impactful trade-off space in a direction that we will not want to pursue long-term. It does, however, provide significant (as much as 2x, depending on circumstances) performance improvements that are valuable until PR #391 hits.

Prior to this commit, the hb_cache system referenced all messages via their uncommitted ID, which is linked to from all committed IDs. Each commitment was then stored in the commitments key of this message.

Upside: A consequence of this design is that reading one ID for a message (whether signed or unsigned) leads to all of the known commitments being available for use. Downside: This design reads all commitments into memory every time a single message is read.

While sometimes useful, this is not desirable behavior in all cases. #391 moves us forward with a long-term fix, but until that hits edge this PR provides immediate performance relief, while also leading to a modest increase in the size of caches.

This change moves our position in an impactful trade-off space in a direction that we will not want to pursue long-term. It does, however, provide significant (as much as 2x, depending on circumstances) performance improvements that are valuable until PR #391 hits.

Prior to this commit, the `hb_cache` system referenced all messages via their uncommitted ID, which is linked to from all committed IDs. Each commitment was then stored in the `commitments` key of this message.

Upside: A consequence of this design is that reading one ID for a message (whether signed or unsigned) leads to all of the known commitments being available for use. Downside: This design reads _all_ commitments into memory every time a single message is read.

While sometimes useful, this is not desirable behavior in all cases. #391 moves us forward with a long-term fix, but until that hits `edge` this PR provides immediate performance relief, while also leading to a modest increase in the size of caches.
@samcamwilliams samcamwilliams merged commit 8d3405f into edge Aug 8, 2025
@samcamwilliams samcamwilliams deleted the temp/separated-messages branch August 8, 2025 19:46
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.

2 participants