Scan for MIME boundaries and base64 whitespace a word at a time (no new dependencies) - #143
Open
kurok wants to merge 1 commit into
Open
Scan for MIME boundaries and base64 whitespace a word at a time (no new dependencies)#143kurok wants to merge 1 commit into
kurok wants to merge 1 commit into
Conversation
kurok
force-pushed
the
memmem-boundary-search
branch
2 times, most recently
from
August 28, 2026 07:30
6b19540 to
2449fdb
Compare
Owner
|
Thanks, this is something I could conceivably accept. However I'm having a really hard time following the code comments, can you please rewrite them in your own words instead of having the agent generate them? |
Author
|
Sure, wait a 10 minutes |
find_from_u8 and the whitespace strip in decode_base64 tested one byte at a time and dominated parse_mail on messages with large attachments. Both now scan a usize at a time using the haszero/hasless bit tricks, in plain std, no unsafe. Semantics unchanged; tests compare both against the old loops over every byte value and alignment. Full parse of a 767 KiB message: 1.09 ms -> 0.23 ms. Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
kurok
force-pushed
the
memmem-boundary-search
branch
from
August 28, 2026 10:53
2449fdb to
abb3319
Compare
Author
|
Rewrote the comments and trimmed the commit message / description. Hopefully easier to follow now. |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
find_from_u8and the whitespace strip indecode_base64tested one byte at a time and dominatedparse_mailon messages with large attachments. Both now scan ausizeat a time using the haszero/hasless bit tricks — plainstd, nounsafe, no new dependencies (this replaces #142, which addedmemchr).Semantics are unchanged; the new tests compare both functions against the old loops over every byte value and alignment.
Full parse of a 767 KiB message with four base64 attachments, measured from a dependent crate: