Repository navigation
Avoid temporary copies for normalized line endings - #1035
Merged
Merged
Conversation
This was referenced Oct 5, 2026
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.
Repeated normalization of CRLF files creates two full-size temporary strings even when every newline already has the requested style. Keep the original string when its newline pairs are valid, and retain the existing conversion path for mixed or nonconforming endings.
The shared PowerForge normalizer keeps the same byte output, encoding conversion, change reporting, replacement count, and timestamp behavior. No public API or dependency changes are required. Regression cases cover trailing CR/LF and automatic style selection.
Validation: 45 focused normalization, formatting-pipeline, formatter-session, and isolation tests pass; net472, net8.0, and net10.0 builds pass without warnings. An original-source oracle matches 6,138 cases each in PowerShell 7.6.6 and Windows PowerShell 5.1.
The PowerForge benchmark runner compares the merged baseline against this candidate using normalized source text from Locksmith and Locksmith2. Two warmups and seven rotated measurements per lane, fixed normal priority, and separate CPU cache domains show about 19–46% lower normalization time. Every sample preserves bytes and timestamps. These are isolated normalization measurements; they do not establish a full-build speedup. Consumer repinning requires a public PSPublishModule release containing the owner changes.