next.js
0bb13fa6 - [turbopack] optimize the TurboMalloc threadlocals (#80265)

Commit
200 days ago
[turbopack] optimize the TurboMalloc threadlocals (#80265) Improve memory tracking in turbo-tasks-malloc ### What? Made the thread_local initializer `const` compatible. This skips per-thread lazy initialization of the threadlocal datastructure which allows us to skip a small amount of bootstrapping logic. Additionally, this allows us to access the native llvm implementation of threadlocals which can improve performance. See https://matklad.github.io/2020/10/03/fast-thread-locals-in-rust.html ### Performance Confusingly, the benchmarks are not positive, but vercel-site appears to be. Perhaps the 'small' benchmarks are just too small/ ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/AwJ29EfoPcPdLSwCZxAz/51a29e9b-d653-4ba1-8e18-063b6a60c3a9.png)
Author
Parents
Loading