Summary
WindowsStore::try_from in crates/pet-windows-store/src/lib.rs (line ~104-112) creates a normalize_for_comparison closure that strips \\?\ prefixes and calls norm_case on every invocation. If try_from is called in a hot loop during locator identification, the repeated allocations could add up.
Proposed Fix
Normalize paths once at discovery time (in find()) rather than on every try_from call. Store the normalized form alongside the raw path in the environment locations cache.
Impact
Minor performance concern. Locator identification during refresh iterates all environments × all locators, so try_from is called frequently. Profiling would confirm whether this is measurable.
Summary
WindowsStore::try_fromincrates/pet-windows-store/src/lib.rs(line ~104-112) creates anormalize_for_comparisonclosure that strips\\?\prefixes and callsnorm_caseon every invocation. Iftry_fromis called in a hot loop during locator identification, the repeated allocations could add up.Proposed Fix
Normalize paths once at discovery time (in
find()) rather than on everytry_fromcall. Store the normalized form alongside the raw path in the environment locations cache.Impact
Minor performance concern. Locator identification during refresh iterates all environments × all locators, so
try_fromis called frequently. Profiling would confirm whether this is measurable.