Skip to content

Commit ea14605

Browse files
committed
WIP: print output meta data size
1 parent 34a2620 commit ea14605

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

turbopack/crates/turbo-tasks-backend/src/backend/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
10201020
followers_count: usize,
10211021
collectibles_dependents_count: usize,
10221022
aggregated_dirty_containers_count: usize,
1023+
output_size: usize,
10231024
}
10241025
#[cfg(feature = "print_cache_item_size")]
10251026
impl TaskCacheStats {
@@ -1052,6 +1053,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
10521053
self.followers_count += counts.followers;
10531054
self.collectibles_dependents_count += counts.collectibles_dependents;
10541055
self.aggregated_dirty_containers_count += counts.aggregated_dirty_containers;
1056+
if let Some(output) = storage.get_output() {
1057+
use turbo_bincode::turbo_bincode_encode;
1058+
1059+
self.output_size += turbo_bincode_encode(&output)
1060+
.map(|data| data.len())
1061+
.unwrap_or(0);
1062+
}
10551063
}
10561064
}
10571065
#[cfg(feature = "print_cache_item_size")]

turbopack/crates/turbo-tasks-backend/src/backend/storage_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct TaskStorageSchema {
8080
/// The task's output value.
8181
/// Filtered during serialization to skip transient outputs (referencing transient tasks).
8282
#[field(storage = "direct", category = "meta", inline, filter_transient)]
83-
output: Option<OutputValue>,
83+
pub output: Option<OutputValue>,
8484

8585
/// Upper nodes in the aggregation tree (reference counted).
8686
#[field(storage = "counter_map", category = "meta", inline, filter_transient)]

0 commit comments

Comments
 (0)