Commit b14bb91
⚡ Bolt: [performance improvement] Optimize iter_batch slicing (#468)
* perf: optimize iter_batch for indexable sequences
Adds a fast path using direct sequence slicing in `iter_batch` to avoid the overhead of `itertools.islice(iter(x))` for lists and tuples, yielding approximately a 2x performance speedup while preserving original type signatures and error behavior.
Co-authored-by: n24q02m <135627235+n24q02m@users.noreply.github.com>
* fix: enforce iter_batch upper boundary limits
Adds an upper boundary check to `iter_batch` size to ensure parity with `itertools.islice`, resolving CI failures on Windows runners that triggered tests using `sys.maxsize + 1` sizes or where large ranges raised `OverflowError`. Also cleaned up temporary test files.
Co-authored-by: n24q02m <135627235+n24q02m@users.noreply.github.com>
* fix: remove emoji from source code to fix Windows CI
Removes an emoji from a code comment in `qwen3_embed/common/utils.py`. On Windows CI runners, `pytest-cov` (`coverage.py`) reads source files using the default local encoding (typically cp1252), causing a `UnicodeDecodeError` when encountering non-ASCII characters, which crashes the test suite.
Co-authored-by: n24q02m <135627235+n24q02m@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent c0ddd14 commit b14bb91
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | | - | |
| 83 | + | |
71 | 84 | | |
72 | 85 | | |
73 | 86 | | |
| |||
0 commit comments