Skip to content

refactor(line_index): use SIMD intrinsics for better performance#10221

Draft
dyc3 wants to merge 1 commit into
mainfrom
dyc3/simd-line-index
Draft

refactor(line_index): use SIMD intrinsics for better performance#10221
dyc3 wants to merge 1 commit into
mainfrom
dyc3/simd-line-index

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented May 3, 2026

Summary

This essentially uses SIMD intrinsics to add a ASCII fast path to the scanning that LineIndex does. On my machine, the benchmarks indicate speedups from ~1.5 GB/s to anywhere between ~2.8-10+ GB/s throughput. Notably, there is a regression in speed when (approximately 0.33x) for text that is made of majority unicode text. For most code (particularly JS, CSS, GraphQL), this is likely not going to be a problem, but HTML and JSON documents are more likely to have problems because those usually contain data that is meant for humans to read.

I used gpt 5.5 to do the initial research and the implementations.

Test Plan

Tested locally on my x64 machine

Using CI to test the ARM path since our runners are ARM based.

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 3, 2026

⚠️ No Changeset found

Latest commit: 6a95add

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dyc3 dyc3 force-pushed the dyc3/simd-line-index branch from 8077ddc to 6b666b5 Compare May 3, 2026 20:51
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 3, 2026

Merging this PR will not alter performance

✅ 249 untouched benchmarks


Comparing dyc3/simd-line-index (6a95add) with main (91ed677)

Open in CodSpeed

@dyc3 dyc3 force-pushed the dyc3/simd-line-index branch from f87cbf0 to 6a95add Compare May 6, 2026 23:17
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