chore: eliminate all 57 build warnings#86
Merged
cloud-hai-vo merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
The "Update README with benchmark results" step only ran on push events. Manual workflow_dispatch runs completed benchmarks but skipped the README update step. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CS8604 (nullable arg): add null-forgiving ! in Mapper.cs where source is guaranteed non-null by upstream checks - CS8602 (nullable deref): add ! to test assertions in OpenGenericMapTests - CS8604 in ExpressionBuilder: add null check before nestedDel call (also fixes review finding — self-referencing type null safety) - xUnit1031 (blocking task): convert ThreadSafetyTests to async/await - NU1701 (package compat): suppress in Analyzers.Tests csproj Build now produces 0 warnings across all TFMs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
📊 Benchmark Results
🔵 Flat Mapping — 10-property object
🟡 Flattening — 2 nested objects → 8 flat properties
🟣 Deep Mapping — 2 nested address objects
🟢 Complex Mapping — nested object + collection
🟠 Collection — 100-item
|
| Method | Mean | Error | StdDev | Min | Median | Max | Ratio | RatioSD | Rank | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Manual | 1.732 μs | 0.2412 μs | 0.0132 μs | 1.720 μs | 1.729 μs | 1.746 μs | 1.00 | 0.01 | 1 | 0.5283 | 0.0172 | 8.65 KB | 1.00 |
| EggMapper | 1.741 μs | 0.2083 μs | 0.0114 μs | 1.729 μs | 1.744 μs | 1.752 μs | 1.01 | 0.01 | 1 | 0.5283 | 0.0172 | 8.65 KB | 1.00 |
| AutoMapper | 2.353 μs | 0.5409 μs | 0.0296 μs | 2.319 μs | 2.368 μs | 2.372 μs | 1.36 | 0.02 | 2 | 0.6065 | 0.0191 | 9.95 KB | 1.15 |
| Mapster | 1.810 μs | 0.7127 μs | 0.0391 μs | 1.774 μs | 1.803 μs | 1.852 μs | 1.04 | 0.02 | 1 | 0.5283 | 0.0172 | 8.65 KB | 1.00 |
| MapperlyMap | 1.854 μs | 0.4237 μs | 0.0232 μs | 1.836 μs | 1.845 μs | 1.880 μs | 1.07 | 0.01 | 1 | 0.5283 | 0.0172 | 8.65 KB | 1.00 |
| AgileMapper | 2.615 μs | 0.4369 μs | 0.0239 μs | 2.588 μs | 2.624 μs | 2.634 μs | 1.51 | 0.02 | 2 | 0.5417 | 0.0153 | 8.91 KB | 1.03 |
🟠 Collection — 100-item List<T>
| Method | Mean | Error | StdDev | Min | Median | Max | Ratio | RatioSD | Rank | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Manual | 5.174 μs | 0.3606 μs | 0.0198 μs | 5.161 μs | 5.164 μs | 5.196 μs | 1.00 | 0.00 | 1 | 1.6708 | 0.0916 | 27.4 KB | 1.00 |
| EggMapper | 5.646 μs | 0.4772 μs | 0.0262 μs | 5.616 μs | 5.656 μs | 5.666 μs | 1.09 | 0.01 | 1 | 1.6708 | 0.0916 | 27.4 KB | 1.00 |
| AutoMapper | 6.372 μs | 0.4758 μs | 0.0261 μs | 6.346 μs | 6.373 μs | 6.398 μs | 1.23 | 0.01 | 1 | 1.7548 | 0.1068 | 28.7 KB | 1.05 |
| Mapster | 5.694 μs | 0.6734 μs | 0.0369 μs | 5.653 μs | 5.704 μs | 5.725 μs | 1.10 | 0.01 | 1 | 1.6708 | 0.0916 | 27.4 KB | 1.00 |
| MapperlyMap | 5.285 μs | 1.6353 μs | 0.0896 μs | 5.208 μs | 5.264 μs | 5.383 μs | 1.02 | 0.02 | 1 | 1.6785 | 0.0992 | 27.42 KB | 1.00 |
| AgileMapper | 5.146 μs | 0.3460 μs | 0.0190 μs | 5.134 μs | 5.137 μs | 5.168 μs | 0.99 | 0.00 | 1 | 1.0223 | 0.0610 | 16.72 KB | 0.61 |
🟠 Collection — 100-item List<T>
| Method | Mean | Error | StdDev | Min | Median | Max | Ratio | RatioSD | Rank | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Manual | 16.50 μs | 3.727 μs | 0.204 μs | 16.35 μs | 16.41 μs | 16.73 μs | 1.00 | 0.02 | 1 | 5.2490 | 1.3123 | 85.99 KB | 1.00 |
| EggMapper | 17.76 μs | 1.684 μs | 0.092 μs | 17.65 μs | 17.80 μs | 17.82 μs | 1.08 | 0.01 | 1 | 5.2490 | 1.3123 | 85.99 KB | 1.00 |
| AutoMapper | 21.00 μs | 0.666 μs | 0.036 μs | 20.97 μs | 20.98 μs | 21.04 μs | 1.27 | 0.01 | 1 | 5.7678 | 1.4343 | 94.34 KB | 1.10 |
| Mapster | 17.05 μs | 3.607 μs | 0.198 μs | 16.84 μs | 17.09 μs | 17.23 μs | 1.03 | 0.02 | 1 | 5.2490 | 1.3123 | 85.99 KB | 1.00 |
| MapperlyMap | 18.17 μs | 0.527 μs | 0.029 μs | 18.15 μs | 18.17 μs | 18.20 μs | 1.10 | 0.01 | 1 | 5.2490 | 1.2817 | 86.02 KB | 1.00 |
| AgileMapper | 20.27 μs | 2.938 μs | 0.161 μs | 20.13 μs | 20.24 μs | 20.45 μs | 1.23 | 0.02 | 1 | 5.2795 | 1.3123 | 86.25 KB | 1.00 |
⚪ Startup / Configuration time
| Method | Mean | Error | StdDev | Min | Median | Max | Ratio | RatioSD | Rank | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EggMapperStartup | 1,306.824 μs | 1,389.9702 μs | 76.1890 μs | 1,230.727 μs | 1,306.641 μs | 1,383.104 μs | 1.002 | 0.07 | 3 | 3.9063 | 1.9531 | 94.82 KB | 1.00 |
| AutoMapperStartup | 452.114 μs | 888.0934 μs | 48.6794 μs | 408.306 μs | 443.518 μs | 504.519 μs | 0.347 | 0.04 | 2 | 5.8594 | - | 104.07 KB | 1.10 |
| MapsterStartup | 2.477 μs | 0.5669 μs | 0.0311 μs | 2.447 μs | 2.475 μs | 2.509 μs | 0.002 | 0.00 | 1 | 0.7019 | 0.0267 | 11.51 KB | 0.12 |
EggMapper.Benchmarks.ColdStartBenchmark-report-github
| Method | Mean | Error | StdDev | Min | Median | Max | Ratio | RatioSD | Rank | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EggMapper | 1.289 ms | 1.710 ms | 0.0937 ms | 1.231 ms | 1.238 ms | 1.397 ms | 1.00 | 0.09 | 1 | 3.9063 | 1.9531 | 95.33 KB | 1.00 |
| AutoMapper | 3.871 ms | 9.205 ms | 0.5046 ms | 3.435 ms | 3.754 ms | 4.424 ms | 3.01 | 0.39 | 2 | 15.6250 | 7.8125 | 310.22 KB | 3.25 |
| Mapster | 4.496 ms | 9.104 ms | 0.4990 ms | 3.929 ms | 4.695 ms | 4.865 ms | 3.50 | 0.40 | 2 | 39.0625 | 15.6250 | 757.6 KB | 7.95 |
📝 Notes
- Each benchmark class is decorated with
[MemoryDiagnoser]and[RankColumn]. - The global config (see
src/EggMapper.Benchmarks/Program.cs) addsMin,Median, andMaxcolumns. - Manual is the hand-written baseline (ratio = 1.00). A ratio < 1 means faster than manual.
- Benchmarks run on GitHub-hosted runners — absolute times may vary between runs; focus on Ratio for comparisons.
- To reproduce locally:
cd src/EggMapper.Benchmarks dotnet run --configuration Release -- --filter '*'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Build produced 57 warnings across 3 categories, cluttering CI output and hiding real issues.
Fix
!where null already checked upstream!in test assertions<NoWarn>in Analyzers.Tests csprojasync Task+await Task.WhenAllBuild now: 0 warnings across all TFMs.
Test plan
dotnet build --configuration Release🤖 Generated with Claude Code