Closed benbrandt closed 3 weeks ago
Attention: Patch coverage is 98.26087%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 99.50%. Comparing base (
b1b39d1
) to head (26998f1
).:exclamation: Current head 26998f1 differs from pull request most recent head a38ded3
Please upload reports for the commit a38ded3 to get more accurate results.
Files | Patch % | Lines |
---|---|---|
src/splitter.rs | 96.33% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Optimizes the binary search to not be too greedy when checking the size of sections.
Previously, I relied on the fact that we'd find a semantic level that didn't fit in the chunk size. However, it is quite likely there won't be one, and then the reliance on having this to scope the sections we are binary searching over means that in worst case, we are binary searching over the entire rest of the document, which might be large search area, and requires tokenizing huge chunks of text, which is the real bottleneck.
Now, we increase the search area by a factor of 2 each successful attempt, and also keep track of updating our starting
low
value for the binary search if we already know it is too low.