Skip to content

perf(memo): reduce hot-path allocation overhead - #15748

Open
rgrinberg wants to merge 1 commit into
ocaml:mainfrom
rgrinberg:push-ustsqurunrmr
Open

perf(memo): reduce hot-path allocation overhead#15748
rgrinberg wants to merge 1 commit into
ocaml:mainfrom
rgrinberg:push-ustsqurunrmr

Conversation

@rgrinberg

@rgrinberg rgrinberg commented Aug 9, 2026

Copy link
Copy Markdown
Member

Reduce allocation and container overhead along common Memo execution paths:

  • return successful cached values without constructing error-mapping closures;
  • inline event notification and cycle-edge bookkeeping;
  • avoid set lookup for the first cycle-detection edge and force lazy cycle nodes without callback allocation;
  • store call stacks directly and simplify stack-frame creation.

Avoid closures and unnecessary container operations in common Memo execution
and cycle-detection paths. Store call stacks directly and simplify stack-frame
creation to reduce allocation further.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant