next.js
7578b8fe - perf(turbo-tasks): Add a 'local' option to `#[turbo_tasks::function(..)]` (#75259)

Commit
333 days ago
perf(turbo-tasks): Add a 'local' option to `#[turbo_tasks::function(..)]` (#75259) Allows tasks to be marked as local using `#[turbo_tasks::function(local)]`. Local tasks are cached only for the lifetime of the nearest non-Local parent caller. Local tasks do not have a unique task id, and are not shared with the backend. Instead they use the parent task's id and store data in the backend-agnostic manager. This is useful for functions that have a low cache hit rate. Those functions could be converted to non-task functions, but that would break their function signature. This provides a mechanism for skipping caching without changing the function signature. Local tasks are already used for argument resolution, this allows other arbitrary functions to be opted-in.
Author
bgw bgw
Parents
Loading