Skip to content

chore: improve note_getter performance on >1 notes#20508

Merged
nventuro merged 1 commit intonextfrom
nv/note_getter_no_confirmed_notes_ram
Feb 16, 2026
Merged

chore: improve note_getter performance on >1 notes#20508
nventuro merged 1 commit intonextfrom
nv/note_getter_no_confirmed_notes_ram

Conversation

@nventuro
Copy link
Contributor

@nventuro nventuro commented Feb 13, 2026

Explanation in the source code.

I've not run our own benchmarks on this yet, but a benchmark from externals reported a decrease from 140k gates to 90k when running a simple contract that read 8 notes, and 260k to 160k with 16 notes. We should see similar results in our own setup.

edit: alternative explanation from Slack, in case anyone finds it useful:

image

@nventuro nventuro requested a review from benesjan February 13, 2026 22:44
@nventuro nventuro enabled auto-merge February 13, 2026 23:17
Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

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

LGTM

I have some questions:

  1. Do you understand why Noir messes this up when we use a normal constant for options.limit but it doesn't mess it up when a numeric type parameter is used? Both are a thing that is determined at comptime so this is very strange to me.
  2. Can you think of a legitimate use of RAM in our codebase? Would it be reasonable to just have Noir error out when RAM is used? Feels like whenever we use RAM it's a bug.

Thanks

@nventuro nventuro added this pull request to the merge queue Feb 16, 2026
Merged via the queue into next with commit 8cbc804 Feb 16, 2026
21 checks passed
@nventuro nventuro deleted the nv/note_getter_no_confirmed_notes_ram branch February 16, 2026 09:54
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