AngouriMath
Navigation
NodeStack
Description
Summary
The pre-order walk behind Nodes: the node, then each child's walk in
order, kept on an explicit stack rented from Shared.
order, kept on an explicit stack rented from Shared.
Remarks
LINQ iterators costs an iterator per node per enumeration, and caching it on every
node keeps that chain alive as long as the node; caching the walk's result instead is
quadratic in memory, since every node would hold its whole subtree (31 MB on a sum of
2000 terms).
#534
is being walked, on this thread or another, shares nothing with it. A walk that is
abandoned without Release only fails to give its array back to the
pool. It is a mutable struct: copying one mid-walk would share the array, so it is
only ever held in a local or in NodeWalk.
Members
Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 6003 pages online