perf: fix Instagram parsing regression, optimize allocations#7
Merged
Berektassuly merged 1 commit intomainfrom Dec 27, 2025
Merged
Conversation
Major performance improvements to Instagram parsing: - Add `parse_instagram_message_owned()` that takes ownership of InstagramRawMessage to avoid unnecessary String clones - Use `into_iter()` instead of `iter()` in InstagramParser to enable move semantics for message data - Add ASCII fast-path in `fix_mojibake_encoding()` - mojibake only affects non-ASCII text, so skip processing for ASCII strings - Skip `fix_mojibake_encoding()` entirely for ASCII content/sender in both owned and reference versions of parse functions Results: - Instagram parsing: 2.0 M/s -> 3.4-3.6 M/s (+70-80% throughput) - Regression fixed: was +37% slower, now faster than baseline - merge/filter regression reduced from +10-20% to +3-8%
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Major performance improvements to Instagram parsing:
parse_instagram_message_owned()that takes ownership of InstagramRawMessage to avoid unnecessary String clonesinto_iter()instead ofiter()in InstagramParser to enable move semantics for message datafix_mojibake_encoding()- mojibake only affects non-ASCII text, so skip processing for ASCII stringsfix_mojibake_encoding()entirely for ASCII content/sender in both owned and reference versions of parse functionsResults: