build: Add generated code performance benchmarks#55
Conversation
Add BenchmarkDotNet benchmarks for generated CompositeKey code to establish a performance baseline before structural refactoring begins. - Create CompositeKey.Benchmarks console project targeting net8.0/net9.0/net10.0 - Add BenchmarkDotNet 0.15.8 to central package management - Define four representative key types covering all major code-generation paths: GuidPrimaryKey (stackalloc split), MixedCompositeKey (string.Create exact length, partition/sort), RepeatingCollectionKey (DefaultInterpolatedStringHandler), FastPathEnumKey (generated enum helpers) - Benchmark ToString, Parse, TryParse, ToPartitionKeyString, ToSortKeyString - Track throughput, heap allocations, and GC collections via MemoryDiagnoser - Add BenchmarkDotNet.Artifacts/ to .gitignore - Add benchmarks README with run instructions and result interpretation guide
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThis pull request introduces a new BenchmarkDotNet-based benchmarking project for CompositeKey, establishing performance baselines across representative key types targeting net8.0, net9.0, and net10.0, with benchmarks for ToString, Parse, and TryParse operations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
=======================================
Coverage 87.66% 87.66%
=======================================
Files 35 35
Lines 2099 2099
Branches 344 344
=======================================
Hits 1840 1840
Misses 157 157
Partials 102 102 ☔ View full report in Codecov by Sentry. |
Summary
CompositeKey.Benchmarksconsole project (net8.0/net9.0/net10.0) with BenchmarkDotNet 0.15.8string.Create, interpolation formatting,DefaultInterpolatedStringHandlerwith repeating sections, fast-path enum helpers, partition/sort splitting, same-separator repeating,ImmutableArraycollection construction, andSpanParsableitem parsingToString,Parse,TryParse,ToPartitionKeyString, andToSortKeyStringwith[MemoryDiagnoser]tracking throughput, allocations, and GC collectionsBenchmarkDotNet.Artifacts/to.gitignore, benchmarks README, andCLAUDE.mdsectionTest plan
dotnet run -c Release --project src/CompositeKey.Benchmarks -- --filter "*" --job shortCloses #40
Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores