mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-27 07:04:35 +00:00
Use inputs_outputs
len as approximation
This commit is contained in:
parent
8f6dcaf632
commit
5314d4ccc9
1 changed files with 5 additions and 11 deletions
|
@ -1,3 +1,5 @@
|
|||
use super::{Configuration, IngredientImpl};
|
||||
use crate::zalsa_local::QueryOrigin;
|
||||
use crate::{
|
||||
accumulator::{self, accumulated_map::AccumulatedMap},
|
||||
hash::FxHashSet,
|
||||
|
@ -5,8 +7,6 @@ use crate::{
|
|||
AsDynDatabase, DatabaseKeyIndex, Id,
|
||||
};
|
||||
|
||||
use super::{Configuration, IngredientImpl};
|
||||
|
||||
impl<C> IngredientImpl<C>
|
||||
where
|
||||
C: Configuration,
|
||||
|
@ -76,15 +76,9 @@ where
|
|||
continue;
|
||||
};
|
||||
|
||||
let estimated_inputs = match &origin {
|
||||
QueryOrigin::Assigned(_) | QueryOrigin::BaseInput => 0,
|
||||
QueryOrigin::Derived(edges) | QueryOrigin::DerivedUntracked(edges) => {
|
||||
edges.input_outputs.len()
|
||||
}
|
||||
};
|
||||
|
||||
stack.reserve(estimated_inputs);
|
||||
visited.reserve(estimated_inputs);
|
||||
if let QueryOrigin::Derived(edges) | QueryOrigin::DerivedUntracked(edges) = &origin {
|
||||
stack.reserve(edges.input_outputs.len());
|
||||
}
|
||||
|
||||
stack.extend(
|
||||
origin
|
||||
|
|
Loading…
Reference in a new issue