Unverified Commit 00817437 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

[Turbopack] fix task optimization by removing children count (#74907)

### What?

fix an earlier PR by completely removing children count
parent 5de932a4
...@@ -23,7 +23,9 @@ use crate::{ ...@@ -23,7 +23,9 @@ use crate::{
invalidate::{make_task_dirty, TaskDirtyCause}, invalidate::{make_task_dirty, TaskDirtyCause},
ExecuteContext, Operation, TaskGuard, ExecuteContext, Operation, TaskGuard,
}, },
storage::{get, get_many, iter_many, remove, update, update_count, update_ucount_and_get}, storage::{
count, get, get_many, iter_many, remove, update, update_count, update_ucount_and_get,
},
TaskDataCategory, TaskDataCategory,
}, },
data::{ data::{
...@@ -1860,7 +1862,7 @@ impl AggregationUpdateQueue { ...@@ -1860,7 +1862,7 @@ impl AggregationUpdateQueue {
let _span = trace_span!("check optimize").entered(); let _span = trace_span!("check optimize").entered();
let task = ctx.task(task_id, TaskDataCategory::Meta); let task = ctx.task(task_id, TaskDataCategory::Meta);
let children_count = get!(task, ChildrenCount).copied().unwrap_or_default(); let children_count = count!(task, Child);
if children_count == 0 { if children_count == 0 {
return; return;
} }
......
...@@ -365,9 +365,6 @@ pub enum CachedDataItem { ...@@ -365,9 +365,6 @@ pub enum CachedDataItem {
task: TaskId, task: TaskId,
value: (), value: (),
}, },
ChildrenCount {
value: u32,
},
// Cells // Cells
CellData { CellData {
...@@ -497,7 +494,6 @@ impl CachedDataItem { ...@@ -497,7 +494,6 @@ impl CachedDataItem {
} }
CachedDataItem::Dirty { .. } => true, CachedDataItem::Dirty { .. } => true,
CachedDataItem::Child { task, .. } => !task.is_transient(), CachedDataItem::Child { task, .. } => !task.is_transient(),
CachedDataItem::ChildrenCount { .. } => true,
CachedDataItem::CellData { .. } => true, CachedDataItem::CellData { .. } => true,
CachedDataItem::CellTypeMaxIndex { .. } => true, CachedDataItem::CellTypeMaxIndex { .. } => true,
CachedDataItem::OutputDependency { target, .. } => !target.is_transient(), CachedDataItem::OutputDependency { target, .. } => !target.is_transient(),
...@@ -553,7 +549,6 @@ impl CachedDataItem { ...@@ -553,7 +549,6 @@ impl CachedDataItem {
match self { match self {
Self::Collectible { .. } Self::Collectible { .. }
| Self::Child { .. } | Self::Child { .. }
| Self::ChildrenCount { .. }
| Self::CellData { .. } | Self::CellData { .. }
| Self::CellTypeMaxIndex { .. } | Self::CellTypeMaxIndex { .. }
| Self::OutputDependency { .. } | Self::OutputDependency { .. }
...@@ -595,7 +590,6 @@ impl CachedDataItemKey { ...@@ -595,7 +590,6 @@ impl CachedDataItemKey {
} }
CachedDataItemKey::Dirty { .. } => true, CachedDataItemKey::Dirty { .. } => true,
CachedDataItemKey::Child { task, .. } => !task.is_transient(), CachedDataItemKey::Child { task, .. } => !task.is_transient(),
CachedDataItemKey::ChildrenCount {} => true,
CachedDataItemKey::CellData { .. } => true, CachedDataItemKey::CellData { .. } => true,
CachedDataItemKey::CellTypeMaxIndex { .. } => true, CachedDataItemKey::CellTypeMaxIndex { .. } => true,
CachedDataItemKey::OutputDependency { target, .. } => !target.is_transient(), CachedDataItemKey::OutputDependency { target, .. } => !target.is_transient(),
...@@ -639,7 +633,6 @@ impl CachedDataItemType { ...@@ -639,7 +633,6 @@ impl CachedDataItemType {
match self { match self {
Self::Collectible { .. } Self::Collectible { .. }
| Self::Child { .. } | Self::Child { .. }
| Self::ChildrenCount { .. }
| Self::CellData { .. } | Self::CellData { .. }
| Self::CellTypeMaxIndex { .. } | Self::CellTypeMaxIndex { .. }
| Self::OutputDependency { .. } | Self::OutputDependency { .. }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment