-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of Tar library #74281
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d52d836
Avoid unnecessary byte[] allocations
stephentoub 1e5020e
Remove unnecessary use of FileStreamOptions
stephentoub 6938c77
Clean up Dispose{Async} implementations
stephentoub 5fa03e9
Clean up unnecessary consts
stephentoub 8dd0ac1
Remove MemoryStream/Encoding.UTF8.GetBytes allocations, unnecessary a…
stephentoub 5be57ad
Avoid string allocations in ReadMagicAttribute
stephentoub ab71e6c
Avoid allocation in WriteAsOctal
stephentoub df2d742
Improve handling of octal
stephentoub c6058bd
Avoid allocation for version string
stephentoub 5756a8c
Removing boxing and char string allocation in GenerateExtendedAttribu…
stephentoub 9539a4a
Fix a couple unnecessary dictionary lookups
stephentoub 74bbc9c
Replace Enum.HasFlag usage
stephentoub 46e0855
Remove allocations from Write{Posix}Name
stephentoub 02ca7da
Replace ArrayPool use with string.Create
stephentoub f9eb99f
Replace more superfluous ArrayPool usage
stephentoub add6179
Remove ArrayPool use from System.IO.Compression.ZipFile
stephentoub 6f8cb75
Fix inverted condition
stephentoub 827a588
Use generic math to parse octal
stephentoub ae21478
Remove allocations from StringReader and string.Split
stephentoub d6b6727
Remove magic string allocation for Ustar when not V7
stephentoub 480af5c
Remove file name and directory name allocation in GenerateExtendedAtt…
stephentoub File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If on Unix both these constants are
/
runtime/src/libraries/Common/src/System/IO/PathInternal.Unix.cs
Lines 13 to 14 in e71a958
we could skip the cycle on Unix. On Windows we could do only one check
\
in the cycle.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is the same on both platforms.
@EgorBo just out of curiosity, would the JIT in theory be able to legally collapse such a thing? ie,
if (ch == '/' || ch == '/')
..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes no sense to replace
/
with/
on Unix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that, but what are you proposing -- duplicate this method for Unix and Windows so they can be different? Is this code path that hot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not super hot, but it can be improved. I need to push up a fix anyway, so I'll do so.