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

[Turbopack] add tracing to task execution #74770

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
improve aggregation update tracing
sokra committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit fadf5279a8f64afee4055c83bfc92b2fe0e04e2a
Original file line number Diff line number Diff line change
@@ -1568,7 +1568,7 @@ impl AggregationUpdateQueue {
) {
#[cfg(feature = "trace_aggregation_update")]
let _span =
trace_span!("process update aggregation numger", base_aggregation_number).entered();
trace_span!("check update aggregation number", base_aggregation_number).entered();

let mut task = ctx.task(task_id, TaskDataCategory::Meta);
let current = get!(task, AggregationNumber).copied().unwrap_or_default();
@@ -1601,7 +1601,13 @@ impl AggregationUpdateQueue {
}
} else {
#[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!("update aggregation numger", aggregation_number).entered();
let _span = trace_span!(
"update aggregation number",
task = ctx.get_task_description(task_id),
old,
aggregation_number
)
.entered();
task.insert(CachedDataItem::AggregationNumber {
value: AggregationNumber {
base: base_aggregation_number,
@@ -1655,7 +1661,7 @@ impl AggregationUpdateQueue {
/// upper edges as this amplifies the updates needed when changes to that task occur.
fn optimize_task(&mut self, ctx: &mut impl ExecuteContext<'_>, task_id: TaskId) {
#[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!("optimize").entered();
let _span = trace_span!("check optimize").entered();

let task = ctx.task(task_id, TaskDataCategory::Meta);
let aggregation_number = get!(task, AggregationNumber).copied().unwrap_or_default();
@@ -1750,6 +1756,14 @@ impl AggregationUpdateQueue {
}

if aggregation_number.effective != new_aggregation_number {
#[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!(
"optimize",
upper_count,
old_aggregation_number = aggregation_number.effective,
new_aggregation_number,
)
.entered();
self.push(AggregationUpdateJob::UpdateAggregationNumber {
task_id,
base_aggregation_number: new_aggregation_number

Unchanged files with check annotations Beta

/// Determines if the module is an internal asset (i.e overlay, fallback) coming
/// from the embedded FS, don't apply user defined transforms.
///
/// [TODO] turbopack specific embed fs should be handled by internals of

Check warning on line 147 in crates/next-core/src/util.rs

GitHub Actions / rustdoc check / build

unresolved link to `TODO`
/// turbopack itself and user config should not try to leak this. However,
/// currently we apply few transform options subject to next.js's configuration
/// even if it's embedded assets.
}
}
/// Subscribes to lifecycle events of the compilation.

Check warning on line 983 in crates/napi/src/next_api/project.rs

GitHub Actions / rustdoc check / build

public documentation for `project_update_info_subscribe` links to private item `UpdateMessage::Start`

Check warning on line 983 in crates/napi/src/next_api/project.rs

GitHub Actions / rustdoc check / build

public documentation for `project_update_info_subscribe` links to private item `UpdateMessage::End`

Check warning on line 983 in crates/napi/src/next_api/project.rs

GitHub Actions / rustdoc check / build

public documentation for `project_update_info_subscribe` links to private item `UpdateMessage::End`

Check warning on line 983 in crates/napi/src/next_api/project.rs

GitHub Actions / rustdoc check / build

public documentation for `project_update_info_subscribe` links to private item `UpdateMessage::Start`
///
/// Emits an [UpdateMessage::Start] event when any computation starts.
/// Emits an [UpdateMessage::End] event when there was no computation for the