next.js
543edced - [turbopack] Move global names onto the NativeFunction object (#81143)

Commit
246 days ago
[turbopack] Move global names onto the NativeFunction object (#81143) ### What? Instead of a global `&'static NativeFunction`->`&'static str` map, just put the names onto the `NativeFunction` struct and delete the global map. ### Why? Using a RwLock means every read requires a `fetch_add` to update the reader count, so if lookups are performed on multiple threads we can expect contention on the RwLock reader count. Using a OnceLock instead just means we need to perform a consistent read which shouldn't trigger cross processor cache traffic. I don't know that this is a problem, and if it is it would only show up during PC serialization.
Author
Parents
Loading