next.js
713bd675 - turbo-tasks: compile conditional cell updates once, not per cell type (#97763)

Commit
19 hours ago
turbo-tasks: compile conditional cell updates once, not per cell type (#97763) ### What? Makes `CurrentCellRef::conditional_update_with_shared_reference` compile once instead of once per cell type. **−345 KiB** of code `__text` 66,832,376 → 66,479,352, measured on `libnext_napi_bindings.dylib` with the shipped release profile (thin LTO, `codegen-units = 1`, `--icf=all`). The 1,302 instantiations of this function collapse to **1**. ### Why? The function took its callback as `impl FnOnce`, so it was monomorphized for every `VcValueType` in the dependency graph — but its body is identical for all of them: read the cell, call the callback, hand the result to the *non-generic* `update_own_task_cell`. Nothing in it depends on the cell type.
Author
Parents
Loading