You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug:map_view_base Lookup failure case is several orders slower due to C++ exceptions #1511
I created a synthetic benchmark to test the perf of the failed case of Lookup(), that generates a C++ exception (impl below hresult_out_of_bounds()), and it reports the following when compared to the OS implementation of ValueSet. Lookup is called in TryLookup to simplify usage.
CppWinRT Map
TryLookup fails
100000 iterations, 2021ms, 0ms per iteration
TryLookup succeeds
100000 iterations, 5ms, 0ms per iteration
ValueSet
TryLookup fails
100000 iterations, 2ms, 0ms per iteration
TryLookup succeeds
100000 iterations, 3ms, 0ms per iteration
thanks for pointing that out. I commented in that completed PR but repeating that here; making 2 calls is fine for in proc, but OOP APIs, where the cost per call is high, that is a problem. Antonio is making progress on a fix for this.
Activity
kennykerr commentedon Sep 17, 2025
Related workaround in Rust to avoid the cost of C++ exceptions: microsoft/windows-rs#3476
ChrisGuzak commentedon Sep 17, 2025
thanks for pointing that out. I commented in that completed PR but repeating that here; making 2 calls is fine for in proc, but OOP APIs, where the cost per call is high, that is a problem. Antonio is making progress on a fix for this.
github-actions commentedon Sep 28, 2025
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.