Commit c51fb58
docs(SegmentTree): describe the baseline as a fold loop, not a Min() call
The baseline was written as `values.AsSpan(start, length).Min()` in the type
docs, the API reference and the benchmark header. Two things wrong with it.
It is min-specific, in the docs for a type whose whole point is an arbitrary
associative fold. And it does not compile: `Span<T>` has no `Min` — there is
no MemoryExtensions overload for it — so a reader who tried the snippet would
find out the hard way.
Reworded all three as what the baseline actually is: a hand-written loop that
folds the slice element by element, O(n) per query whatever the fold, against
which precomputing the answers instead trades the cost onto every point
update. The absence of a span helper is now stated rather than assumed, and
range minimum is named as the instance the benchmark measures — it is the
cheapest fold that loop can carry, so it is the baseline's best case.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d646716 commit c51fb58
3 files changed
Lines changed: 10 additions & 6 deletions
File tree
- docs/api
- src
- Celerity.Benchmarks
- Celerity/Collections
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4279 | 4279 | | |
4280 | 4280 | | |
4281 | 4281 | | |
4282 | | - | |
| 4282 | + | |
4283 | 4283 | | |
4284 | 4284 | | |
4285 | 4285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
0 commit comments