Skip to content

Conversation

@neilmayhew
Copy link
Contributor

This greatly reduces the amount of memory needed for the whole UTxO case

Changelog

- description: |
    Use lazy ByteString for writing out result of utxo query
  type:
  - optimisation   # measurable performance improvements

Context

Running cardano-cli query utxo --whole-utxo --output-cbor takes up a large amount of memory as the UTxO is fetched and then serialized to hex cbor.

How to trust this PR

The previous code was encoding to a lazy BS, converting it to strict, converting it back to lazy, and then writing it out as lazy. This just removes the intermediate strict BS by using the lazy variant of Base16.

The benefit is seen when doing cardano-cli query utxo --whole-utxo --output-cbor: the memory footprint is quite a bit less.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

This greatly reduces the amount of memory needed for the whole UTxO case
@neilmayhew neilmayhew force-pushed the nm/lbs-utxo-query-output branch from dda40dc to 21322c7 Compare May 3, 2025 04:19
@newhoggy newhoggy enabled auto-merge May 4, 2025 13:44
@newhoggy newhoggy added this pull request to the merge queue May 4, 2025
Merged via the queue into master with commit 85b6a87 May 4, 2025
24 of 25 checks passed
@newhoggy newhoggy deleted the nm/lbs-utxo-query-output branch May 4, 2025 13:55
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