mirror of
https://github.com/Z3Prover/z3
synced 2026-07-04 22:36:10 +00:00
perf
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f261c7732b
commit
e011aead11
1 changed files with 4 additions and 2 deletions
|
|
@ -57,6 +57,7 @@ namespace seq {
|
||||||
|
|
||||||
// Reset only operation caches (union/inter/concat/complement)
|
// Reset only operation caches (union/inter/concat/complement)
|
||||||
// while preserving derivative caches (m_cache, m_top_cache)
|
// while preserving derivative caches (m_cache, m_top_cache)
|
||||||
|
// The op cache does index on m_ele so it has to be reset if m_ele changes.
|
||||||
void derive::reset_op_caches() {
|
void derive::reset_op_caches() {
|
||||||
m_union_cache.reset();
|
m_union_cache.reset();
|
||||||
m_inter_cache.reset();
|
m_inter_cache.reset();
|
||||||
|
|
@ -81,8 +82,9 @@ namespace seq {
|
||||||
result = cached;
|
result = cached;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// Cache and pin the final result
|
// Pin ele and r
|
||||||
m_trail.push_back(ele);
|
m_trail.push_back(ele);
|
||||||
|
m_trail.push_back(r);
|
||||||
|
|
||||||
// Always compute the SYMBOLIC derivative wrt the canonical
|
// Always compute the SYMBOLIC derivative wrt the canonical
|
||||||
// variable v (so the cached result is reusable for any
|
// variable v (so the cached result is reusable for any
|
||||||
|
|
@ -100,7 +102,7 @@ namespace seq {
|
||||||
result = derive_rec(r);
|
result = derive_rec(r);
|
||||||
m_top_cache.insert(ele, r, result);
|
m_top_cache.insert(ele, r, result);
|
||||||
|
|
||||||
m_trail.push_back(r);
|
// pin the final result
|
||||||
m_trail.push_back(result);
|
m_trail.push_back(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue