You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove graph_lock from the _schema_at hot path #128
Every lookup takes the lock once, and the first lookup of a key takes it twice. Before #126 this path was lock-free once the graph existed, but it rebuilt the view on every call. Uncontended, the lock costs about 200 ns per call. Under multi-threaded decoding it serializes lookups.
The lock is required: subschemas is a plain Dict written by concurrent decoders, so the read cannot simply drop it.
Options:
Precompute views for all known descriptors when the graph is built. Descriptors are per-call-site constants in generated code, so this needs codegen to register them.
Keep an immutable cache and swap it atomically on miss. Reads become lock-free, and a miss copies the cache.
Activity