perf(chunker): thread DocProfile through splitter dispatch
Strategy.Split / SplitWithDiagnostics already run ProfileDocument once when the auto strategy resolves the chain. splitByHeadingsImpl was rerunning the same O(N) pass on entry, so every auto-mode call paid 2x scan cost; SplitParentChild paid 2x per parent. Pass the profile down through runTier and let splitters compute their own only when called outside the auto path (where profile == nil).
This commit is contained in:
@@ -27,7 +27,11 @@ type boundary struct {
|
||||
|
||||
// splitByHeuristicsImpl is the Tier-2 implementation. Falls through to the
|
||||
// legacy splitter when no heuristic boundaries are found.
|
||||
func splitByHeuristicsImpl(text string, cfg SplitterConfig) []Chunk {
|
||||
//
|
||||
// profile is currently unused (this tier scans for boundaries directly) but
|
||||
// is accepted to keep the splitByHeadings / splitByHeuristics signatures
|
||||
// uniform — see strategy.runTier.
|
||||
func splitByHeuristicsImpl(text string, cfg SplitterConfig, _ *DocProfile) []Chunk {
|
||||
if text == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user