Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(turbo-tasks): Optionally schedule ResolveNative/ResolveTrait tasks as local tasks #69126

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,11 +1124,11 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
let (span, future) = match task_type {
TaskType::Cached(task_type) => match &*task_type {
CachedTaskType::Native { fn_type, this, arg } => (
registry::get_function(*fn_type).span(task_id),
registry::get_function(*fn_type).span(task_id.persistence()),
registry::get_function(*fn_type).execute(*this, &**arg),
),
CachedTaskType::ResolveNative { fn_type, .. } => {
let span = registry::get_function(*fn_type).resolve_span(task_id);
let span = registry::get_function(*fn_type).resolve_span(task_id.persistence());
let turbo_tasks = turbo_tasks.pin();
(
span,
Expand Down
4 changes: 2 additions & 2 deletions turbopack/crates/turbo-tasks-memory/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ impl Task {
arg,
} => {
let func = registry::get_function(*native_fn_id);
let span = func.span(self.id);
let span = func.span(self.id.persistence());
let entered = span.enter();
let future = func.execute(*this, &**arg);
drop(entered);
Expand All @@ -785,7 +785,7 @@ impl Task {
arg,
} => {
let func = registry::get_function(*native_fn_id);
let span = func.resolve_span(self.id);
let span = func.resolve_span(self.id.persistence());
let entered = span.enter();
let future = Box::pin(CachedTaskType::run_resolve_native(
*native_fn_id,
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bench = false
default = []
tokio_tracing = ["tokio/tracing"]
hanging_detection = []
local_resolution = []

[lints]
workspace = true
Expand Down
Loading
Loading