mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-02 09:46:06 +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::{
|
use crate::{
|
||||||
accumulator::{self, accumulated_map::AccumulatedMap},
|
accumulator::{self, accumulated_map::AccumulatedMap},
|
||||||
hash::FxHashSet,
|
hash::FxHashSet,
|
||||||
|
@ -5,8 +7,6 @@ use crate::{
|
||||||
AsDynDatabase, DatabaseKeyIndex, Id,
|
AsDynDatabase, DatabaseKeyIndex, Id,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{Configuration, IngredientImpl};
|
|
||||||
|
|
||||||
impl<C> IngredientImpl<C>
|
impl<C> IngredientImpl<C>
|
||||||
where
|
where
|
||||||
C: Configuration,
|
C: Configuration,
|
||||||
|
@ -76,15 +76,9 @@ where
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
let estimated_inputs = match &origin {
|
if let QueryOrigin::Derived(edges) | QueryOrigin::DerivedUntracked(edges) = &origin {
|
||||||
QueryOrigin::Assigned(_) | QueryOrigin::BaseInput => 0,
|
stack.reserve(edges.input_outputs.len());
|
||||||
QueryOrigin::Derived(edges) | QueryOrigin::DerivedUntracked(edges) => {
|
}
|
||||||
edges.input_outputs.len()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
stack.reserve(estimated_inputs);
|
|
||||||
visited.reserve(estimated_inputs);
|
|
||||||
|
|
||||||
stack.extend(
|
stack.extend(
|
||||||
origin
|
origin
|
||||||
|
|
Loading…
Reference in a new issue