Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- `src/compute_MTG/indexing.jl`
- `src/compute_MTG/check_filters.jl`
- `src/types/Node.jl`
- `src/types/Attributes.jl`
- `src/compute_MTG/node_funs.jl`

## Practical Optimization Rules
Expand All @@ -30,4 +31,14 @@
- `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.

## Benchmark Tiers
- `small` (~10k nodes): full matrix including API-surface benchmarks
- `medium` (~100k nodes): hot-path matrix
- `large` (~300k nodes): critical hot paths only
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
XLSX = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0"

[compat]
Expand All @@ -25,6 +26,7 @@ MetaGraphsNext = "0.5, 0.6, 0.7"
MutableNamedTuples = "0.1"
OrderedCollections = "1.4"
SHA = "0.7, 1"
Tables = "1"
XLSX = "0.7, 0.8, 0.9, 0.10"
julia = "1.6"

Expand Down
4 changes: 4 additions & 0 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
MultiScaleTreeGraph = "dd4a991b-8a45-4075-bede-262ee62d5583"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[sources]
MultiScaleTreeGraph = {path = ".."}
21 changes: 18 additions & 3 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ julia --project=benchmark benchmark/benchmarks.jl

Workloads currently covered:

- full-tree traversal
- traversal + data extraction from descendants
- repeated many-small queries (`children`, `parent`, `ancestors`)
- tiered datasets: `small` (~10k nodes), `medium` (~100k), `large` (~300k)
- full-tree traversal and traversal updates
- one attribute update on all nodes
- multi-attribute update on one symbol (`:Leaf`)
- multi-attribute update on mixed symbols (`[:Leaf, :Internode]`)
- descendants queries
- one/many attributes, one symbol
- one/many attributes, mixed symbols
- `ignore_nothing=true/false`
- in-place and allocating variants
- repeated many-small queries
- `children`, `parent`, `ancestors`, `ancestors!`
- repeated descendants retrieval with and without in-place buffers
- API surface (small tier)
- insertion/deletion/pruning
- `transform!`, `select!`
- `symbol_table` / `mtg_table`
- `write_mtg`
Loading
Loading