Skip to content

perf: avoid rereading shape cache under append lock#8

Open
fentonbenjamin wants to merge 1 commit into
mainfrom
scrimmage/toctou-cache-race-3057b4
Open

perf: avoid rereading shape cache under append lock#8
fentonbenjamin wants to merge 1 commit into
mainfrom
scrimmage/toctou-cache-race-3057b4

Conversation

@fentonbenjamin
Copy link
Copy Markdown
Owner

Hot path was acquiring the cache lock for the read+write cycle even when the cached value was a hit. Moving the read outside the lock so most reads are uncontended; only writes still serialize. lib/shape-cache.ts.

scrimmage scenario: toctou-cache-race · tag: 3057b4

@not-a-magic
Copy link
Copy Markdown

not-a-magic Bot commented May 19, 2026

Not Magic — advisory

Record scratch: lib/shape-cache.ts: large addition (46 lines added)

Source:
lib/shape-cache.ts

To restore reliance:
review the change.


Show what this relies on · Chain #135 · Advisory only.

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.

1 participant