Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Merge Protections🔴 1 of 2 protections blocking · waiting on 🤖 CI
🔴 Ready to land on mainWaiting for
This rule is failing.CI green, authored or approved by a maintainer, review threads resolved, not held.
Show 1 satisfied protection🟢 🚦 Auto-mergeWhen all merge protections are satisfied and these conditions match, this pull request will be merged automatically.
|
GetFormattingNumberFormatresolved the culture three times on each call. It also allocated a closure and a key string on each call.ByteSize,ToMetric,OrdinalizeandFractionalizeuse this method.This change resolves the culture one time and uses a separate cache with
TryGetValue. A cache hit does not allocate. The output does not change. A new test makes sure that a culture with no override keeps its ownNumberFormat.BenchmarkDotNet, Apple M2 Max (ARM64). Old code against old code moved by 0.5% or less.
ByteSize.Humanize()ByteSize.Humanize(), fi-FIByteSize.Humanize(), invariantByteSize.ToString(format, culture)ToMetric(decimals: 2)ToMetric, 5 cultures in turnNo benchmark became slower. I did not measure x64.
Tests pass on net8.0, net10.0 and net11.0. Old and new code gave the same output for 1.2M random inputs in 10 cultures.
CI can fail because of the
System.Security.Cryptography.Pkcsadvisory onmain(see #1987).Summary by CodeRabbit