Skip to content

feat(simd-split-at-semicolon): Semicolon index calculation using SIMD (~= 10%)#21

Open
manuelgdlvh wants to merge 1 commit intojonhoo:mainfrom
manuelgdlvh:feat/simd-split-at-semicolon
Open

feat(simd-split-at-semicolon): Semicolon index calculation using SIMD (~= 10%)#21
manuelgdlvh wants to merge 1 commit intojonhoo:mainfrom
manuelgdlvh:feat/simd-split-at-semicolon

Conversation

@manuelgdlvh
Copy link
Copy Markdown

@manuelgdlvh manuelgdlvh commented Dec 21, 2025

SIMD works best when we don’t need extra assumptions or manual data alignment, and when all calculations are data simple pipeline transformations.

Thanks to the guarantees discussed in #2 (comment) about where the ; can appear (between buffer_len - 7 and buffer_len - 4), we can safely use a u8x4 SIMD search and get his max power.

With this change, the computation time goes below 700 milliseconds.

Before
image

After
image

I also made a small change in find_new_line(), related to an edge case.
When there are no more aligned-lane chunks, it is usually better to use a scalar calculation at the end instead of aligning the buffer to use SIMD.
This has no high impact, since this path is executed very few times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant