| 118 |
118 |
|
|
| 119 |
119 |
|
## Performance Characteristics
|
| 120 |
120 |
|
|
| 121 |
|
- |
Criterion benchmarks cover six groups at multiple scales (1K, 10K, 50K tags):
|
|
121 |
+ |
Criterion benchmarks cover ten groups at multiple scales (1K, 10K, 50K tags):
|
| 122 |
122 |
|
|
| 123 |
123 |
|
| Benchmark Group | What it measures |
|
| 124 |
124 |
|
|----------------|------------------|
|
| 126 |
126 |
|
| `hierarchy` | parent, leaf, depth, ancestors, is_ancestor_of, common_ancestor |
|
| 127 |
127 |
|
| `sql` | escape_like, like_descendant_pattern |
|
| 128 |
128 |
|
| `tree_ops` | children_at_prefix, subtree, rename_prefix |
|
| 129 |
|
- |
| `tag_index` | Build time, suggest (prefix/path/exact/no-match) at 1K/10K/50K |
|
|
129 |
+ |
| `tag_index` | Build time, suggest (prefix/path/exact/no-match), suggest_fuzzy (typo/no-match) |
|
|
130 |
+ |
| `bulk_ops` | rename_prefix_bulk, remove_subtree, merge_tags, batched renames (10K) |
|
| 130 |
131 |
|
| `deep_tree` | Validation and traversal at depth 5/10/20, deep-wide trees (~19K nodes) |
|
|
132 |
+ |
| `large_validate` | Validating every tag in a 10K set |
|
|
133 |
+ |
| `large_tree_ops` | Tree operations at 1K/10K/50K |
|
|
134 |
+ |
| `large_tag_index` | Build, suggest and suggest_fuzzy at 1K/10K/50K |
|
| 131 |
135 |
|
|
| 132 |
136 |
|
At typical corpus sizes (hundreds to low thousands), `suggest` completes in single-digit microseconds. Path-prefix lookups are O(log n); segment-prefix scans are gated by a segment index to avoid unnecessary work.
|
| 133 |
137 |
|
|
|
138 |
+ |
`suggest_fuzzy` is the slowest of the three tiers and the one to watch at scale. It runs only when tiers 1 and 2 underfill the limit, and when it does it walks every tag segment with a bounded Levenshtein distance (max 2), so its cost is O(tags * segments) plus the edit-distance work per segment rather than the O(log n) of a path-prefix hit. A query that misses everything (`suggest_fuzzy("zzz", ...)`) is the worst case, since no tier short-circuits it.
|
|
139 |
+ |
|
| 134 |
140 |
|
## Key Paths
|
| 135 |
141 |
|
|
| 136 |
142 |
|
| What | Path |
|