diff --git a/.jules/bolt.md b/.jules/bolt.md index 99b76ee6..bf2aa375 100644 --- a/.jules/bolt.md +++ b/.jules/bolt.md @@ -45,3 +45,7 @@ ## 2026-03-12 - O(1) early exit for confidence level **Learning:** Using `.reduce()` unconditionally iterates over the entire array for operations with an absolute bound (e.g. finding if there's any 'low' confidence section). **Action:** Replace unconditional `.reduce()` with a `for...of` loop and early `break` to short-circuit upon finding the minimum possible bound, changing O(N) worst-case into an O(K) best-case execution, yielding measurable performance gains on large documents. + +## 2026-03-12 - Early exit with for...of in reduce replacements +**Learning:** For performance optimizations involving finding a minimum or maximum value with a known absolute bound, unconditional `.reduce()` calls cannot stop once the bound is found. +**Action:** Use a `for...of` loop over arrays when searching for extrema with known bounds to allow short-circuiting.