next.js
b933d3dc - Turbopack: Remove tokio and turbo-task handles from Invalidator (#88242)

Commit
101 days ago
Turbopack: Remove tokio and turbo-task handles from Invalidator (#88242) We may have many `Invalidator`s, and we're often looping over collections of them. Instead of storing a weak reference to `TurboTasksApi` and tokio's `Handle` inside of `Invalidator`, it's better for the callsite to track this. `Weak<dyn TurboTasksApi>` and `Handle` are both 16-byte fat pointers, and there's some alignment overhead, so **this reduces the size of Invalidator from 40 bytes to 4 bytes** (according to RA), and reduces the number of refcount increment/decrements we have to do when using invalidators. These changes were LLM-generated, with careful manual review and cleanup.
Author
bgw bgw
Parents
Loading