Skip to content

Avoid temporary copies for normalized line endings - #1035

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
fix/module-normalization-performance
Oct 4, 2026
Merged

PrzemyslawKlys merged 1 commit into
mainfrom
fix/module-normalization-performance

Conversation

@PrzemyslawKlys

Copy link
Copy Markdown
Member

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.

@PrzemyslawKlys
PrzemyslawKlys merged commit 8ea730c into main Oct 4, 2026
9 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the fix/module-normalization-performance branch October 4, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant