Skip to content

Improve performance of multipart boundary searching#6

Merged
kitten merged 3 commits intomainfrom
@kitten/refactor/index-of-perf
Nov 21, 2025
Merged

Improve performance of multipart boundary searching#6
kitten merged 3 commits intomainfrom
@kitten/refactor/index-of-perf

Conversation

@kitten
Copy link
Copy Markdown
Owner

@kitten kitten commented Nov 21, 2025

The current approach of looking for the first character in the boundary with indexOf is really slow and naive. Instead, we can use a skip table while searching for the first character. To keep the code relatively the same, we don't perfom a first search and basically only give indexOf the knowledge of the full boundary. It'll use the first and last character, and a skip table to optimise its performance and skip over parts of the boundary.

@kitten kitten merged commit b8c4324 into main Nov 21, 2025
2 checks passed
@github-actions github-actions bot mentioned this pull request Nov 21, 2025
@kitten kitten deleted the @kitten/refactor/index-of-perf branch February 16, 2026 03:25
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