- Optimize traversal-heavy workloads for very large trees.
- Prioritize low allocations and type-stable code paths.
- Local suite:
julia --project=benchmark benchmark/benchmarks.jl
- Package tests (workaround for current precompile deadlock on Julia 1.12.1):
julia --project --compiled-modules=no -e 'using Pkg; Pkg.test()'
- Uses
AirspeedVelocity.jlvia.github/workflows/Benchmarks.yml. - Benchmark definitions live in
benchmark/benchmarks.jland must exposeconst SUITE.
src/compute_MTG/traverse.jlsrc/compute_MTG/ancestors.jlsrc/compute_MTG/descendants.jlsrc/compute_MTG/indexing.jlsrc/compute_MTG/check_filters.jlsrc/types/Node.jlsrc/types/Attributes.jlsrc/compute_MTG/node_funs.jl
- Avoid allocating temporary arrays in per-node loops.
- Prefer in-place APIs for repeated queries:
ancestors!(buffer, node, key; ...)descendants!(buffer, node, key; ...)
- Keep filter checks branch-light when no filters are provided.
- Keep key access on typed attribute containers (
NamedTuple,MutableNamedTuple, typed dicts) in specialized methods when possible. - Prefer explicit attribute APIs:
attribute(node, key)attribute!(node, key, value)attributes(node; format=:namedtuple|:dict)add_column!/drop_column!/rename_column!
- Preserve API behavior and add tests for every optimization that changes internals.
small(~10k nodes): full matrix including API-surface benchmarksmedium(~100k nodes): hot-path matrixlarge(~300k nodes): critical hot paths only