Repository navigation
Use spans to reduce allocations in Maps - #40785
Conversation
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
/review expert-review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/review expert-review |
This comment has been minimized.
This comment has been minimized.
Selected Tests
🧪 Test selection — click to expand
🧪 UI tests — nothing to run❌ Could not queue 🧪 Running — nothingNo UI tests run for this PR. 🧪 Device tests — nothing to run❌ Could not queue 🧪 Running — nothingNo device tests run for this PR. ⏭️ Skipped — what neither suite runsUI tests — 77 categories, 4 platforms Platforms not run: Android, iOS, MacCatalyst, Windows Each skipped platform and category is listed as a Device tests — 105 categories, 4 platforms Platforms not run: Android, iOS, MacCatalyst, Windows Each skipped platform and project is listed as a 🤖 Why these tests — AI rationaleUI testsNo rationale provided. Device testsNo rationale provided. Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification. |
94138e4 to
cc5e8b3
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The prerequisite stack drops netstandard support without evaluating external-consumer compatibility, requiring maintainer review, and compilation of the changed Android handler remains unverified.
No open issues 🎉
What changed in this PR
This PR completes the Maps layer of the .NET 12 span-allocation work, building on the Essentials changes in #40783.
Changes:
- Replaces string splitting with span-based
MapSpanparsing and uses invariant-culture interpolation for formatting. - Replaces Android polygon/polyline LINQ projections with pre-sized, indexed list construction.
- Expands converter tests and adds a Maps parsing benchmark.
Benchmark measurements are historical; Android compilation was not validated locally.
| File | Description |
|---|---|
src/Core/tests/Benchmarks/Core.Benchmarks.csproj |
Adds the Maps project reference for benchmarking. |
src/Core/tests/Benchmarks/Benchmarks/EssentialsMapsBenchmarker.cs |
Adds a MapSpanTypeConverter.ConvertFrom benchmark. |
src/Core/maps/src/Handlers/Map/MapHandler.Android.cs |
Shares pre-sized point-list construction for polygons and polylines. |
src/Core/maps/src/Converters/MapSpanTypeConverter.cs |
Reduces parsing and formatting allocations. |
src/Controls/tests/Core.UnitTests/MapSpanTypeConverterTests.cs |
Covers malformed input, exact formatting, culture independence, and invalid values. |
Review effort: Balanced
cc5e8b3 to
c3dd4cd
Compare
3d81afb to
da63daf
Compare
da63daf to
153648e
Compare
153648e to
99d0fbe
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
99d0fbe to
e273583
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The prerequisite stack’s netstandard removal leaves external-consumer compatibility unassessed, requiring maintainer evaluation, while current-head Android compilation remains unverified.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The prerequisite .NET 12 stack’s removal of netstandard support still requires external-consumer compatibility evaluation, and the changed Android handler lacks confirmed build and runtime validation.
No open issues 🎉
Review effort: Balanced
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
cc5e8b30c6a4a9e4b9c7ec8fe4802536ef6fb4b76f75ab472d; diff is the same five Maps files.↑ On net12.0: 200/200 Map-filtered Controls.Core tests and 19/19 converter tests pass; benchmark project builds with 0 warnings; format check clean.
↓ net12 Android MapHandler not compiled locally (NETSDK1139: the installed Android workload targets net11); relies on CI.
↓ Benchmark numbers are historical and not rerun; ConvertTo change not benchmarked; CI for this head not inspected.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.This is the final Maps layer of the .NET 12 spans stack. Its immediate base is
simonrozsival-net12-essentials-spans(#40783), rebased onto that branch's head6f75ab472d03f5dc70154418240bf2338f098b65. GitHub native stack registration is handled separately.Description of Change
Important
Reviewers: please weigh the risk of breaking external consumers and dependencies that require netstandard before merging. That compatibility evaluation has not been done in this PR.
ConvertTooutput with a singlestring.Create(CultureInfo.InvariantCulture, ...)interpolation instead of four separateToString(CultureInfo.InvariantCulture)calls and two concatenated strings. Output order, separators, invariant numeric formatting andNotSupportedExceptionfor non-MapSpanvalues are unchanged.Only these five files differ from the immediate base:
src/Core/maps/src/Converters/MapSpanTypeConverter.cssrc/Core/maps/src/Handlers/Map/MapHandler.Android.cssrc/Controls/tests/Core.UnitTests/MapSpanTypeConverterTests.cssrc/Core/tests/Benchmarks/Benchmarks/EssentialsMapsBenchmarker.cs(Maps import, field and method only)src/Core/tests/Benchmarks/Core.Benchmarks.csproj(Maps project reference only)Benchmark evidence (historical, from the earlier combined-source run)
MapSpanTypeConverter.ConvertFromThese figures are historical. They come from an earlier benchmark of the combined source branch (commit
04fb9f8a71) and were not rerun for this PR or this head. That run's exact runtime was not preserved, so no .NET 12 benchmark runtime is claimed. Short-run timings are noisy, and this split layer was not measured on its own. There is no benchmark evidence for the Android polygon/polyline change, and theConvertToformatting change was not benchmarked.Local validation (head
cc5e8b30c6)Local SDK:
12.0.100-alpha.1.26551.101. Portable output TFM:net12.0. Installed workloads: android, ios and maccatalyst, all on net11 (rc.2) manifests.dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false --filter 'FullyQualifiedName~Map' -v:qdotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false --filter 'FullyQualifiedName~MapSpanTypeConverterTests' -v:qdotnet build src/Core/tests/Benchmarks/Core.Benchmarks.csproj -p:IncludeAndroidTargetFrameworks=false -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -v:qdotnet build src/Core/maps/src/Maps.csproj -f net12.0-android -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false -v:qandroidnot recognized for net12.0-android37.0).MapHandler.Android.cswas not compiled locally, so CI must cover it.dotnet format whitespace <project> --no-restore --verify-no-changes --include <changed .cs files> --verbosity quiet(Maps, Controls.Core.UnitTests and Core.Benchmarks projects)git diff --quiet 94138e41fb HEAD -- <Maps source/test files>I did not inspect CI for this head.
Issues Fixed
N/A — performance work, not a bug fix.