-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils: accelerate byte search in big file handles (#4279)
The current implementation was unperformant for multiple reasons: - it searched for lines, which means it forced the internal implementation to search for '\n' in the bytes. - as mentioned in the old comment, it was actually not memory stable, because the length of the line could be huge for big files, and thus didn't really prevent OOM issues. - was not exactly correct, because prevented from finding patterns containing '\n'. On huge file (such as chrome, which is why I started investigating this), this new implementation improves by a factor of 5 the performances of this function, and thus tremendously reducing the amount of time spent here. --------- Co-authored-by: jonathanmetzman <[email protected]>
- Loading branch information
1 parent
b284e12
commit 49a4437
Showing
2 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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