-
Notifications
You must be signed in to change notification settings - Fork 0
V1.0.0/benchmarkdotnet api #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR completes a comprehensive rebranding and restructuring of the repository from "ClassLibrary1" to "Codebelt.Extensions.BenchmarkDotNet." The changes introduce a new BenchmarkDotNet extension library with supporting infrastructure for running performance benchmarks, including workspace management, dependency injection integration, and console hosting capabilities.
Key Changes:
- Complete repository rebranding from ClassLibrary1 to Codebelt.Extensions.BenchmarkDotNet across all documentation, configuration, and code
- Introduction of new BenchmarkDotNet extension libraries with workspace management, DI integration, and console hosting
- Addition of comprehensive unit tests and performance benchmarks following established conventions
- Updated CI/CD pipeline configuration with corrected build settings and package version upgrades
Reviewed changes
Copilot reviewed 46 out of 47 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
Codebelt.Extensions.BenchmarkDotNet.slnx |
New solution structure file organizing projects into /src/, /test/, /tooling/, and /tuning/ folders |
ClassLibrary1.sln |
Legacy solution file removed |
Directory.Build.props |
Updated with new branding, multi-TFM support (net9.0, net10.0), and benchmark project configuration |
Directory.Build.targets |
Added CleanBenchmarkOutput target and reorganized package release notes configuration |
Directory.Packages.props |
Updated package versions including BenchmarkDotNet 0.15.8, new dependencies |
.github/workflows/ci-pipeline.yml |
Renamed pipeline, updated secrets/keys, corrected organization references |
.github/copilot-instructions.md |
Updated coding guidelines with new namespace conventions for Codebelt.Extensions.BenchmarkDotNet |
.github/prompts/benchmark.prompt.md |
New comprehensive benchmark generation guidelines |
src/Codebelt.Extensions.BenchmarkDotNet/* |
Core library with workspace management, options, and DI extensions |
src/Codebelt.Extensions.BenchmarkDotNet.Console/* |
Console hosting components including BenchmarkProgram, BenchmarkWorker, and BenchmarkContext |
test/Codebelt.Extensions.BenchmarkDotNet.Tests/* |
Comprehensive unit tests following Test base class pattern |
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/* |
Console component unit tests with proper namespace alignment |
tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/* |
Performance benchmarks following BenchmarkDotNet conventions |
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/* |
Console component benchmarks |
tooling/Codebelt.Extensions.BenchmarkDotNet.Runner/* |
Benchmark runner executable |
| Legacy ClassLibrary1 files | All removed including src, test projects, and .nuget documentation |
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs
Show resolved
Hide resolved
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs
Show resolved
Hide resolved
tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceBenchmark.cs
Show resolved
Hide resolved
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs
Show resolved
Hide resolved
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
Show resolved
Hide resolved
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
Show resolved
Hide resolved
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughRebrands repository to Codebelt.Extensions.BenchmarkDotNet: removes ClassLibrary1, adds new solution/projects (core library, console host, runner, tuning benchmarks), introduces BenchmarkDotNet workspace/options/worker/program types, extensive tests, benchmark reports, updated CI/docfx/build metadata and packaging metadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CLI as Client/CLI
participant Program as BenchmarkProgram
participant Host as HostBuilder
participant DI as DI Container
participant Worker as BenchmarkWorker
participant Workspace as IBenchmarkWorkspace
participant BDN as BenchmarkDotNet
CLI->>Program: Run(args, optional setup)
Program->>Host: CreateHostBuilder(args)
Host->>DI: Register BenchmarkContext, BenchmarkWorkspaceOptions
alt setup provided
Host->>DI: Apply setup(options)
end
Host->>DI: Register IBenchmarkWorkspace (default/custom)
Program->>Host: Build() & Run()
Host->>Worker: Instantiate via DI
Worker->>Workspace: LoadBenchmarkAssemblies()
Workspace-->>Worker: Assembly[]
alt no args
Worker->>BDN: BenchmarkRunner.Run(assemblies, config)
else args present
Worker->>BDN: BenchmarkSwitcher.Run(args, config)
end
BDN-->>Worker: Results
Worker->>Workspace: PostProcessArtifacts()
Workspace-->>Worker: Done
Worker-->>Host: Exit
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
♻️ Duplicate comments (9)
.github/workflows/ci-pipeline.yml (2)
64-64: Fix the spelling error in the SonarCloud project key.The project key "bemchmarkdotnet" contains a spelling error and will prevent SonarCloud integration from functioning correctly. It should be "benchmarkdotnet" (with 'n' before 'c').
- projectKey: bemchmarkdotnet + projectKey: benchmarkdotnet
73-73: Fix the spelling error in the Codecov repository path.The repository identifier "bemchmarkdotnet" contains a spelling error and will prevent Codecov integration from functioning correctly. It should be "benchmarkdotnet" (with 'n' before 'c').
- repository: codebeltnet/bemchmarkdotnet + repository: codebeltnet/benchmarkdotnetsrc/Codebelt.Extensions.BenchmarkDotNet.Console/Codebelt.Extensions.BenchmarkDotNet.Console.csproj (1)
9-9: Verify central package version management.Similar to the core project, this PackageReference lacks an explicit Version attribute. Ensure versions are managed centrally to avoid unpredictable dependency resolution.
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (1)
193-196: Use atomic file move with overwrite.The current
File.Deletefollowed byFile.Movepattern risks data loss if the move fails after deletion. UseFile.Movewith the overwrite parameter for atomic replacement.- File.Delete(targetFile); - File.Move(file, targetFile); + File.Move(file, targetFile, overwrite: true);tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs (2)
21-21: Unused field_services.The
_servicesfield is initialized inGlobalSetupbut never accessed in any benchmark method. Either remove it or use it in a benchmark.private IConfiguration _configuration; private IHostEnvironment _environment; private BenchmarkWorker _worker; - private IServiceCollection _services;
61-68: Unusedprovidervariable inConfigureServicesWithOptions.The
providervariable is assigned but its value is never read. If the intent is to benchmark the cost of building a service provider, consider usingGC.KeepAlive(provider)or returning a result to prevent the JIT from optimizing away the call.[Benchmark(Description = "Configure services with options")] public IServiceCollection ConfigureServicesWithOptions() { var services = new ServiceCollection(); _worker.ConfigureServices(services); var provider = services.BuildServiceProvider(); + GC.KeepAlive(provider); return services; }tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceBenchmark.cs (1)
37-41: Unused variablevin benchmark.The result of constructing
BenchmarkWorkspaceis assigned tovbut never used. UseGC.KeepAliveto prevent JIT optimization, consistent with other benchmarks in this file.[Benchmark(Baseline = true, Description = "Construct BenchmarkDotNetWorkspace")] public void ConstructWorkspaceBenchmark() { var v = new BenchmarkWorkspace(new BenchmarkWorkspaceOptions()); + GC.KeepAlive(v); }test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (1)
136-138: Tautological assertion - always passes.The expression
isDebugBuild == true || isDebugBuild == falseis always true for any boolean value. This assertion provides no meaningful verification.Consider removing this line or replacing with a more meaningful assertion:
// IsDebugBuild can be true or false, but should be set var isDebugBuild = BenchmarkProgram.IsDebugBuild; - Assert.True(isDebugBuild == true || isDebugBuild == false); + // Verify consistency with BuildConfiguration + Assert.Equal(BenchmarkProgram.BuildConfiguration == "Debug", isDebugBuild);test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs (1)
340-350: DisposeCancellationTokenSourceto avoid resource leak.
CancellationTokenSourceimplementsIDisposable. Wrap it in ausingstatement.var services = CreateServiceProviderWithMocks(); - var cts = new CancellationTokenSource(); - - // Act - var task = worker.RunAsync(services, cts.Token); - - // Assert - await task; - Assert.True(task.IsCompletedSuccessfully); - - TestOutput.WriteLine("RunAsync handled cancellation token"); + using var cts = new CancellationTokenSource(); + + // Act + var task = worker.RunAsync(services, cts.Token); + + // Assert + await task; + Assert.True(task.IsCompletedSuccessfully); + + TestOutput.WriteLine("RunAsync handled cancellation token");
🧹 Nitpick comments (24)
.nuget/Codebelt.Extensions.BenchmarkDotNet.Console/README.md (1)
11-11: Consider simplifying redundant phrase.The phrase "evolve over time" is redundant. Consider shortening to "evolve" for clearer, more concise writing.
Apply this diff:
-By embracing `Microsoft.Extensions.Hosting`, this package enables clean separation between benchmark definition, configuration, and execution - making benchmarks easier to compose, test, and evolve over time. +By embracing `Microsoft.Extensions.Hosting`, this package enables clean separation between benchmark definition, configuration, and execution - making benchmarks easier to compose, test, and evolve..docfx/toc.yml (1)
1-2: Verify "Bootstrapper API" naming choice.The TOC entry uses "Bootstrapper API" but links to
Codebelt.Extensions.BenchmarkDotNet.html. Consider whether "BenchmarkDotNet API" or "Extensions API" would be clearer for users navigating the documentation, as "Bootstrapper" might not be immediately intuitive.Additionally, YAMLlint flags a newline character issue (expected
\n). While this is a minor formatting concern, ensure the file uses consistent Unix-style line endings.Directory.Build.targets (1)
18-20: Confirm scope ofCleanBenchmarkOutput(removing entire$(OutputPath)).Wiping the full
$(OutputPath)before every build for benchmark projects is aggressive and can defeat incremental builds or remove non‑benchmark artifacts under that directory. If the intent is mainly to clear BenchmarkDotNet artifacts, you might narrow the scope to that subfolder (adjust path to match where BDN writes artifacts):- <Target Name="CleanBenchmarkOutput" BeforeTargets="BeforeBuild" Condition="'$(IsBenchmarkProject)' == 'true'"> - <RemoveDir Directories="$(OutputPath)" /> - </Target> + <Target Name="CleanBenchmarkOutput" BeforeTargets="BeforeBuild" Condition="'$(IsBenchmarkProject)' == 'true'"> + <RemoveDir Directories="$(OutputPath)BenchmarkDotNet.Artifacts" /> + </Target>Or keep the current behavior if the full clean is desirable for your workflow.
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspaceBenchmark-report-github.md (1)
1-22: Tighten markdown formatting to satisfy linters (language + table spacing).To address MD040/MD058 and keep reports clean, you can:
-``` +```text @@ -``` -| Method | Runtime | Mean | Error | StdDev | Median | Min | Max | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio | +``` + +| Method | Runtime | Mean | Error | StdDev | Median | Min | Max | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio | @@ -| ''PostProcessArtifacts (move results -> tuning folder)' | .NET 9.0 | 10.349 μs | 0.2326 μs | 0.2585 μs | 10.293 μs | 9.973 μs | 10.872 μs | 3.42 | 0.12 | - | 392 B | 0.09 | +| ''PostProcessArtifacts (move results -> tuning folder)' | .NET 9.0 | 10.349 μs | 0.2326 μs | 0.2585 μs | 10.293 μs | 9.973 μs | 10.872 μs | 3.42 | 0.12 | - | 392 B | 0.09 | +(Blank lines before/after the table can be adjusted as needed, as long as the table is surrounded by at least one blank line.)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkProgramBenchmark-report-github.md (1)
1-28: Align this report’s markdown with lint rules (language + table spacing).Mirroring the other report, consider:
-``` +```text @@ -``` -| Method | Runtime | Mean | Error | StdDev | Median | Min | Max | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio | +``` + +| Method | Runtime | Mean | Error | StdDev | Median | Min | Max | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio | @@ -| ''Static property access pattern' | .NET 9.0 | 0.2924 ns | 0.0498 ns | 0.0466 ns | 0.2807 ns | 0.2035 ns | 0.3729 ns | ? | ? | - | - | ? | +| ''Static property access pattern' | .NET 9.0 | 0.2924 ns | 0.0498 ns | 0.0466 ns | 0.2807 ns | 0.2035 ns | 0.3729 ns | ? | ? | - | - | ? | +This keeps the content identical while satisfying MD040/MD058.
.nuget/Codebelt.Extensions.BenchmarkDotNet/README.md (1)
19-31: Make the C# example self-contained by adding usings for your namespaces.To let consumers copy‑paste the snippet and compile immediately, consider including the relevant usings for your own APIs:
-using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using System; +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Codebelt.Extensions.BenchmarkDotNet; +using Codebelt.Extensions.BenchmarkDotNet.Console;This makes
BenchmarkContextandAddBenchmarkWorkspaceresolve without extra discovery work..docfx/packages/index.md (1)
3-12: Minor wording tweak for subject/verb agreement.In line 3, consider adjusting plural agreement:
-This is a list of all NuGet packages from **Extensions for BenchmarkDotNet by Codebelt** that is publicly available on ... +This is a list of all NuGet packages from **Extensions for BenchmarkDotNet by Codebelt** that are publicly available on ...Everything else in this section looks consistent with the new package naming.
.github/copilot-instructions.md (1)
1-249: Documentation updates look good.The rebranding from
ClassLibrary1toCodebelt.Extensions.BenchmarkDotNetis consistent throughout. The namespace rules and guidelines for unit tests and benchmarks are clear and well-documented.The static analysis hints flag minor markdown formatting issues (missing language specifiers for fenced code blocks on line 166, heading style inconsistencies). These are purely cosmetic and can be addressed optionally.
Apply these fixes if desired:
- ``` + ```csharp namespace Codebelt.Extensions.BenchmarkDotNet.Security.Cryptographysrc/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptionsExtensions.cs (1)
18-24: Duplicate exception documentation.The
<exception>elements are documented twice (lines 18-24 and 58-64). Consider removing one set to avoid documentation drift./// <exception cref="ArgumentNullException"> /// <paramref name="options"/> cannot be null -or- /// <paramref name="configure"/> cannot be null. /// </exception> /// <exception cref="InvalidOperationException"> /// <paramref name="configure"/> must not return null. /// </exception> - /// <remarks> + /// <remarks> /// <para> ... /// </para> /// </remarks> - /// <exception cref="ArgumentNullException"> - /// <paramref name="options"/> cannot be null -or- - /// <paramref name="configure"/> cannot be null. - /// </exception> - /// <exception cref="InvalidOperationException"> - /// <paramref name="configure"/> must not return null. - /// </exception> public static BenchmarkWorkspaceOptions ConfigureBenchmarkDotNet(...)Also applies to: 58-64
README.md (1)
15-15: Wrap bare URL in angle brackets.Per markdownlint MD034, bare URLs should be wrapped in angle brackets or converted to markdown links for consistent rendering across parsers.
-Full documentation (generated by [DocFx](https://github.com/dotnet/docfx)) located here: https://benchmarkdotnet.codebelt.net/ +Full documentation (generated by [DocFx](https://github.com/dotnet/docfx)) located here: <https://benchmarkdotnet.codebelt.net/>src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (4)
82-82: Change return type toList<Assembly>for better performance.Per CA1859, returning
List<Assembly>instead ofIEnumerable<Assembly>avoids the.ToArray()call at the call site and improves performance since the method already builds a list internally.- private static IEnumerable<Assembly> LoadAssemblies(string repositoryPath, string targetFrameworkMoniker, string benchmarkProjectSuffix, string repositoryTuningFolder, bool useDebugBuild) + private static List<Assembly> LoadAssemblies(string repositoryPath, string targetFrameworkMoniker, string benchmarkProjectSuffix, string repositoryTuningFolder, bool useDebugBuild)Also update line 61-66 to avoid
.ToArray():- return LoadAssemblies( - _options.RepositoryPath, - _options.TargetFrameworkMoniker, - _options.BenchmarkProjectSuffix, - _options.RepositoryTuningFolder, - useDebugBuild).ToArray(); + return [.. LoadAssemblies( + _options.RepositoryPath, + _options.TargetFrameworkMoniker, + _options.BenchmarkProjectSuffix, + _options.RepositoryTuningFolder, + useDebugBuild)];
96-99: Usestring.Containsfor improved readability.Per CA2249,
string.ContainswithStringComparisonis more readable thanIndexOf >= 0.var candidatePaths = Directory .EnumerateFiles(tuningDir, $"*.{benchmarkProjectSuffix}.dll", SearchOption.AllDirectories) - .Where(path => path.IndexOf(buildSegment, StringComparison.OrdinalIgnoreCase) >= 0); + .Where(path => path.Contains(buildSegment, StringComparison.OrdinalIgnoreCase));
121-124: Consider logging swallowed exceptions for diagnostics.Swallowing exceptions during assembly loading is reasonable, but consider adding trace/debug logging to aid troubleshooting when assemblies fail to load unexpectedly.
191-191: AddStringComparison.OrdinalIgnoreCasetoEndsWith.Per CA1310,
string.EndsWithwithout aStringComparisonparameter can produce locale-dependent results. Use ordinal comparison for file extensions.- foreach (var file in Directory.GetFiles(reportsResultsPath).Where(s => !s.EndsWith(".lock"))) + foreach (var file in Directory.GetFiles(reportsResultsPath).Where(s => !s.EndsWith(".lock", StringComparison.OrdinalIgnoreCase)))src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (1)
49-78: CancellationToken is ignored during benchmark execution.The
cancellationTokenparameter is received but never used. BenchmarkDotNet'sBenchmarkRunner.RunandBenchmarkSwitcher.Runare synchronous and don't natively support cancellation, so this is understandable. However, consider documenting this limitation or at least checking for cancellation before starting each assembly run.public override Task RunAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken) { var options = serviceProvider.GetRequiredService<BenchmarkWorkspaceOptions>(); var workspace = serviceProvider.GetRequiredService<IBenchmarkWorkspace>(); var assemblies = workspace.LoadBenchmarkAssemblies(); var context = serviceProvider.GetRequiredService<BenchmarkContext>(); try { if (context.Args.Length == 0) { foreach (var assembly in assemblies) { + cancellationToken.ThrowIfCancellationRequested(); BenchmarkRunner.Run(assembly, options.Configuration); } } else { + cancellationToken.ThrowIfCancellationRequested(); BenchmarkSwitcher .FromAssemblies(assemblies) .Run(context.Args, options.Configuration); } } finally { workspace.PostProcessArtifacts(); } return Task.CompletedTask; }tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs (1)
70-80: Trivial benchmarks may not yield meaningful measurements.
AccessConfigurationandAccessEnvironmentonly return pre-initialized fields, which essentially benchmarks field access time. If the intent is to measure property access overhead on the worker, consider accessing_worker.Configurationor similar properties instead (if they exist).tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceBenchmark.cs (1)
17-35: Missing cleanup for temporary directory.
GlobalSetupcreates a temporary directory atPath.GetTempPath()with a GUID-based name and copies files into it, but there's noGlobalCleanupmethod to remove these artifacts. This will leave orphaned directories after benchmark runs.+[GlobalCleanup] +public void GlobalCleanup() +{ + if (Directory.Exists(_workspace?.Options?.RepositoryPath)) + { + Directory.Delete(_workspace.Options.RepositoryPath, recursive: true); + } +}tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkContextBenchmark.cs (1)
68-73: Benchmark measures construction overhead, not just property access.
AccessArgsPropertycreates a newBenchmarkContextin every iteration, so the measurement includes both construction and property access. If the intent is to isolate property access, move context creation toGlobalSetupand store it in a field.+ private BenchmarkContext _contextForPropertyAccess; + [GlobalSetup] public void Setup() { // Deterministic initialization of test data _emptyArgs = []; _smallArgs = new string[8]; for (int i = 0; i < _smallArgs.Length; i++) { _smallArgs[i] = $"--arg{i}"; } _mediumArgs = new string[64]; for (int i = 0; i < _mediumArgs.Length; i++) { _mediumArgs[i] = $"--option{i}"; } _largeArgs = new string[256]; for (int i = 0; i < _largeArgs.Length; i++) { _largeArgs[i] = $"--parameter{i}=value{i}"; } + + _contextForPropertyAccess = new BenchmarkContext(_smallArgs); }Then update the benchmark:
[Benchmark(Description = "Access Args property")] public string[] AccessArgsProperty() { - var context = new BenchmarkContext(_smallArgs); - return context.Args; + return _contextForPropertyAccess.Args; }test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (1)
144-163: Theory test silently skips non-matching cases.This test runs two cases but only one will actually assert anything (the one matching the current build configuration). The other silently logs and passes without verifying anything.
Consider consolidating into a single Fact that always verifies the relationship:
- [Theory] - [InlineData("Debug", true)] - [InlineData("Release", false)] - public void BuildConfiguration_ShouldMatchExpectedDebugState(string expectedConfig, bool expectedIsDebug) + [Fact] + public void BuildConfiguration_ShouldMatchExpectedDebugState() { // Act var actualConfig = BenchmarkProgram.BuildConfiguration; var actualIsDebug = BenchmarkProgram.IsDebugBuild; // Assert - if (actualConfig == expectedConfig) - { - Assert.Equal(expectedIsDebug, actualIsDebug); - TestOutput.WriteLine($"Configuration '{actualConfig}' correctly maps to IsDebugBuild={actualIsDebug}"); - } - else - { - TestOutput.WriteLine($"Skipping assertion - actual configuration is '{actualConfig}', not '{expectedConfig}'"); - } + var expectedIsDebug = actualConfig == "Debug"; + Assert.Equal(expectedIsDebug, actualIsDebug); + TestOutput.WriteLine($"Configuration '{actualConfig}' correctly maps to IsDebugBuild={actualIsDebug}"); }src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (2)
90-90: Hardcoded Danish culture for summary formatting.The
DanishCultureis used forSummaryStyleformatting (Line 224). This affects decimal separators and number formatting in benchmark reports. Consider making this configurable or documenting why Danish culture was chosen.If locale-specific formatting is intentional (e.g., for consistent report formatting), add a comment explaining the rationale. Otherwise, consider using
CultureInfo.InvariantCulturefor consistent output across environments.
284-288: Empty catch blocks hide failures.Swallowing all exceptions silently makes debugging difficult. Consider at minimum logging the exception type or using a more specific exception filter.
catch { - // ignore and fallback to dir inspection + // Fallback to directory inspection if assembly metadata unavailable + // This can happen when running without an entry assembly (e.g., unit tests) }If a logging abstraction is available, consider:
catch (Exception ex) { // Log at Debug level for diagnostics Debug.WriteLine($"TFM resolution from assembly failed: {ex.GetType().Name}"); }test/Codebelt.Extensions.BenchmarkDotNet.Tests/BenchmarkWorkspaceTest.cs (1)
304-322: Consider clarifying the duplicate detection logic.
Distinct()on line 320 uses reference equality forAssemblyobjects. This works correctly ifLoadBenchmarkAssembliesreturns the sameAssemblyinstances for already-loaded assemblies (which is the expected CLR behavior). However, if the intent is to verify no duplicate assembly names are loaded, consider using a more explicit comparison:- var uniqueAssemblies = assemblies.Distinct().ToArray(); - Assert.Equal(assemblies.Length, uniqueAssemblies.Length); + var assemblyNames = assemblies.Select(a => a.GetName().FullName).ToArray(); + var uniqueNames = assemblyNames.Distinct().ToArray(); + Assert.Equal(assemblyNames.Length, uniqueNames.Length);The current implementation is technically correct for the stated purpose but could be more explicit about what "duplicate" means.
test/Codebelt.Extensions.BenchmarkDotNet.Tests/BenchmarkWorkspaceOptionsTest.cs (2)
53-65: Consider using platform-agnostic test paths.The hardcoded Windows path
@"C:\TestRepo"on line 58 may cause confusion or issues when running tests on non-Windows platforms. While this test only verifies string assignment (not filesystem access), usingPath.Combinewould be more consistent:- var testPath = @"C:\TestRepo"; + var testPath = Path.Combine(Path.GetTempPath(), "TestRepo");This is a minor consistency improvement since the property is just storing a string.
400-409: Consider more robust type checking for diagnoser verification.Line 408 uses string matching on
GetType().Name.Contains("Memory")which could be fragile if the type name changes. A more robust approach would be to check for the specific type:- Assert.Contains(options.Configuration.GetDiagnosers(), d => d.GetType().Name.Contains("Memory")); + Assert.Contains(options.Configuration.GetDiagnosers(), d => d is BenchmarkDotNet.Diagnosers.MemoryDiagnoser);This requires adding a using directive for
BenchmarkDotNet.Diagnosersbut provides compile-time safety.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
.docfx/images/32x32.pngis excluded by!**/*.png.docfx/images/50x50.pngis excluded by!**/*.png.docfx/images/favicon.icois excluded by!**/*.ico.nuget/ClassLibrary1/icon.pngis excluded by!**/*.png.nuget/Codebelt.Extensions.BenchmarkDotNet.Console/icon.pngis excluded by!**/*.png.nuget/Codebelt.Extensions.BenchmarkDotNet/icon.pngis excluded by!**/*.png
📒 Files selected for processing (66)
.docfx/BuildDocfxImage.ps1(1 hunks).docfx/PublishDocfxImage.ps1(1 hunks).docfx/api/namespaces/ClassLibrary1.md(0 hunks).docfx/api/namespaces/Codebelt.Extensions.BenchmarkDotNet.Console.md(1 hunks).docfx/api/namespaces/Codebelt.Extensions.BenchmarkDotNet.md(1 hunks).docfx/docfx.json(2 hunks).docfx/includes/availability-default.md(0 hunks).docfx/includes/availability-modern.md(1 hunks).docfx/index.md(1 hunks).docfx/packages/index.md(1 hunks).docfx/toc.yml(1 hunks).github/copilot-instructions.md(6 hunks).github/prompts/benchmark.prompt.md(1 hunks).github/workflows/ci-pipeline.yml(4 hunks).nuget/ClassLibrary1/PackageReleaseNotes.txt(0 hunks).nuget/ClassLibrary1/README.md(0 hunks).nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt(1 hunks).nuget/Codebelt.Extensions.BenchmarkDotNet.Console/README.md(1 hunks).nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt(1 hunks).nuget/Codebelt.Extensions.BenchmarkDotNet/README.md(1 hunks)CHANGELOG.md(1 hunks)ClassLibrary1.sln(0 hunks)Codebelt.Extensions.BenchmarkDotNet.slnx(1 hunks)Directory.Build.props(6 hunks)Directory.Build.targets(1 hunks)Directory.Packages.props(1 hunks)README.md(1 hunks)reports/tuning/Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspaceBenchmark-report-github.md(1 hunks)reports/tuning/Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspaceOptionsBenchmark-report-github.md(1 hunks)reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkContextBenchmark-report-github.md(1 hunks)reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkProgramBenchmark-report-github.md(1 hunks)reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkWorkerBenchmark-report-github.md(1 hunks)src/ClassLibrary1/Class1.cs(0 hunks)src/ClassLibrary1/ClassLibrary1.csproj(0 hunks)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet.Console/Codebelt.Extensions.BenchmarkDotNet.Console.csproj(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptionsExtensions.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/Codebelt.Extensions.BenchmarkDotNet.csproj(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/IBenchmarkWorkspace.cs(1 hunks)src/Codebelt.Extensions.BenchmarkDotNet/ServiceCollectionExtensions.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkContextTest.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/Codebelt.Extensions.BenchmarkDotNet.Console.Tests.csproj(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Tests/BenchmarkWorkspaceOptionsTest.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Tests/BenchmarkWorkspaceTest.cs(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Tests/Codebelt.Extensions.BenchmarkDotNet.Tests.csproj(1 hunks)test/Codebelt.Extensions.BenchmarkDotNet.Tests/ServiceCollectionExtensionsTest.cs(1 hunks)test/TestProject1.FunctionalTests/Class1Test.cs(0 hunks)test/TestProject1.FunctionalTests/TestProject1.FunctionalTests.csproj(0 hunks)test/TestProject1/Class1Test.cs(0 hunks)test/TestProject1/TestProject1.Tests.csproj(0 hunks)testenvironments.json(1 hunks)tooling/Codebelt.Extensions.BenchmarkDotNet.Runner/Codebelt.Extensions.BenchmarkDotNet.Runner.csproj(1 hunks)tooling/Codebelt.Extensions.BenchmarkDotNet.Runner/Program.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceBenchmark.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceOptionsBenchmark.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/Codebelt.Extensions.BenchmarkDotNet.Benchmarks.csproj(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkContextBenchmark.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkProgramBenchmark.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs(1 hunks)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks.csproj(1 hunks)
💤 Files with no reviewable changes (11)
- ClassLibrary1.sln
- .nuget/ClassLibrary1/README.md
- src/ClassLibrary1/Class1.cs
- src/ClassLibrary1/ClassLibrary1.csproj
- .nuget/ClassLibrary1/PackageReleaseNotes.txt
- test/TestProject1.FunctionalTests/TestProject1.FunctionalTests.csproj
- .docfx/api/namespaces/ClassLibrary1.md
- test/TestProject1/Class1Test.cs
- test/TestProject1.FunctionalTests/Class1Test.cs
- .docfx/includes/availability-default.md
- test/TestProject1/TestProject1.Tests.csproj
🧰 Additional context used
🧬 Code graph analysis (12)
src/Codebelt.Extensions.BenchmarkDotNet/IBenchmarkWorkspace.cs (2)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (1)
PostProcessArtifacts(75-80)test/Codebelt.Extensions.BenchmarkDotNet.Tests/ServiceCollectionExtensionsTest.cs (1)
PostProcessArtifacts(53-53)
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs (4)
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkContextBenchmark.cs (5)
GlobalSetup(18-41)Benchmark(43-47)Benchmark(49-53)Benchmark(55-66)Benchmark(68-73)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkProgramBenchmark.cs (7)
GlobalSetup(17-23)Benchmark(25-29)Benchmark(31-35)Benchmark(37-41)Benchmark(43-48)Benchmark(50-54)Benchmark(56-60)test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs (1)
IHostEnvironment(485-494)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (1)
ConfigureServices(34-37)
test/Codebelt.Extensions.BenchmarkDotNet.Tests/ServiceCollectionExtensionsTest.cs (2)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (2)
BenchmarkWorkspaceOptions(60-310)BenchmarkWorkspaceOptions(95-103)src/Codebelt.Extensions.BenchmarkDotNet/IBenchmarkWorkspace.cs (2)
Assembly(14-14)PostProcessArtifacts(19-19)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (3)
BenchmarkWorker(16-79)BenchmarkWorker(23-25)ConfigureServices(34-37)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
BenchmarkContext(6-22)BenchmarkContext(12-15)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkContextTest.cs (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
BenchmarkContext(6-22)BenchmarkContext(12-15)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (3)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkContextTest.cs (11)
Fact(12-21)Fact(23-36)Fact(38-51)Fact(53-70)Fact(72-84)Fact(86-99)Fact(101-117)Fact(143-158)Fact(160-175)Fact(177-190)Fact(192-222)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
BenchmarkProgram(15-69)BenchmarkProgram(17-22)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (2)
BenchmarkWorker(16-79)BenchmarkWorker(23-25)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (3)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs (3)
IHostEnvironment(485-494)IServiceProvider(496-506)PostProcessArtifacts(534-537)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
BenchmarkContext(6-22)BenchmarkContext(12-15)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
Run(44-47)Run(58-68)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptionsExtensions.cs (1)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (2)
BenchmarkWorkspaceOptions(60-310)BenchmarkWorkspaceOptions(95-103)
tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceOptionsBenchmark.cs (1)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (3)
ValidateOptions(188-196)PostConfigureOptions(155-170)ManualConfig(212-227)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
BenchmarkContext(6-22)BenchmarkContext(12-15)
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkProgramBenchmark.cs (2)
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkContextBenchmark.cs (6)
MemoryDiagnoser(6-74)GlobalSetup(18-41)Benchmark(43-47)Benchmark(49-53)Benchmark(55-66)Benchmark(68-73)tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs (7)
MemoryDiagnoser(14-92)GlobalSetup(23-45)Benchmark(47-51)Benchmark(53-59)Benchmark(61-68)Benchmark(70-74)Benchmark(76-80)
test/Codebelt.Extensions.BenchmarkDotNet.Tests/BenchmarkWorkspaceOptionsTest.cs (2)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptionsExtensions.cs (1)
BenchmarkWorkspaceOptions(65-76)src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (5)
BenchmarkWorkspaceOptions(60-310)BenchmarkWorkspaceOptions(95-103)ManualConfig(212-227)PostConfigureOptions(155-170)ValidateOptions(188-196)
🪛 GitHub Check: call-build (Debug) / 🛠️ Build
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
🪛 GitHub Check: call-build (Release) / 🛠️ Build
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
[warning] 82-82:
Change return type of method 'LoadAssemblies' from 'System.Collections.Generic.IEnumerable<System.Reflection.Assembly>' to 'System.Collections.Generic.List<System.Reflection.Assembly>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859)
[warning] 191-191:
The behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings. Replace this call in 'Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspace.CleanupResults(string, string)' with a call to 'string.EndsWith(string, System.StringComparison)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1310)
[warning] 98-98:
Use 'string.Contains' instead of 'string.IndexOf' to improve readability (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249)
🪛 LanguageTool
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkProgramBenchmark-report-github.md
[grammar] ~23-~23: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| 'Access IsDebugBuild property' ...
(QB_NEW_NL)
[grammar] ~24-~24: Zin met fouten
Context: ...| - | - | ? |
| 'Access IsDebugBuild property' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~24-~24: Zin met fouten
Context: ... ? |
| 'Access IsDebugBuild property' | .NET 9.0 | 0.0312 n...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~24-~24: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| 'Check assembly debug build status&...
(QB_NEW_NL)
[grammar] ~25-~25: Zin met fouten
Context: ...| - | - | ? |
| 'Check assembly debug build status' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~25-~25: Zin met fouten
Context: ... ? |
| 'Check assembly debug build status' | .NET 9.0 | 2,434.8425 ns | 1...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~25-~25: Dit kan een fout zijn.
Context: ... ? | 0.5510 | 8825 B | ? |
| 'Resolve build configuration from a...
(QB_NEW_NL)
[grammar] ~26-~26: Zin met fouten
Context: ...| 0.5510 | 8825 B | ? |
| 'Resolve build configuration from assembly' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~26-~26: Zin met fouten
Context: ...| 'Resolve build configuration from assembly' | .NET 9.0 | 2,256.3108 ns | 122.3223 ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~26-~26: Dit kan een fout zijn.
Context: ... ? | 0.5484 | 8793 B | ? |
| 'Check entry assembly debug build s...
(QB_NEW_NL)
[grammar] ~27-~27: Zin met fouten
Context: ...| 0.5484 | 8793 B | ? |
| 'Check entry assembly debug build status' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~27-~27: Zin met fouten
Context: ...| 'Check entry assembly debug build status' | .NET 9.0 | 2,321.5775 ns | 155.7788 n...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~27-~27:
Context: ...ly debug build status' | .NET 9.0 | 2,321.5775 ns | 155.7788 ns | 166.6816...
(QB_NEW_NL_OTHER_ERROR_IDS_UNNECESSARY_ORTHOGRAPHY_SPACE)
[grammar] ~27-~27:
Context: ...64 ns | 2,149.6204 ns | 2,659.6258 ns | ? | ? | 0.5423 | 8561 B | ...
(QB_NEW_NL_OTHER_ERROR_IDS_UNNECESSARY_ORTHOGRAPHY_SPACE)
.nuget/Codebelt.Extensions.BenchmarkDotNet.Console/README.md
[style] ~11-~11: This phrase is redundant. Consider writing “evolve”.
Context: ...benchmarks easier to compose, test, and evolve over time.
At its core, the package favors con...
(EVOLVE_OVER_TIME)
README.md
[style] ~24-~24: Using many exclamation marks might seem excessive (in this case: 10 exclamation marks for a text that’s 2585 characters long)
Context: ...s.BenchmarkDotNet.Console?logo=nuget) | 
.github/copilot-instructions.md
[style] ~59-~59: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...responding unit test class must use the exact same namespace:
```csharp
namespac...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspaceOptionsBenchmark-report-github.md
[grammar] ~16-~16: Dit kan een fout zijn.
Context: ... ? | 0.2657 | 4248 B | ? |
| 'PostConfigureOptions - custom conf...
(QB_NEW_NL)
[grammar] ~17-~17: Zin met fouten
Context: ...| 0.2657 | 4248 B | ? |
| 'PostConfigureOptions - custom config' | .NET 1...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~17-~17: Zin met fouten
Context: ...|
| 'PostConfigureOptions - custom config' | .NET 10.0 | 2,063.4760 ns |...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~17-~17: Dit kan een fout zijn.
Context: ... ? | 0.3027 | 4840 B | ? |
| ...
(QB_NEW_NL)
[grammar] ~18-~18: Fout gevonden
Context: ... | | | |
| 'PostConfigureOptions - default co...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~19-~19: Dit kan een fout zijn.
Context: ... ? | 0.2644 | 4248 B | ? |
| 'PostConfigureOptions - custom conf...
(QB_NEW_NL)
[grammar] ~20-~20: Zin met fouten
Context: ...| 0.2644 | 4248 B | ? |
| 'PostConfigureOptions - custom config' | .NET 9...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~20-~20: Zin met fouten
Context: ...|
| 'PostConfigureOptions - custom config' | .NET 9.0 | 3,027.1892 ns |...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~28-~28: Dit kan een fout zijn.
Context: ... ? | 0.2765 | 4464 B | ? |
| ...
(QB_NEW_NL)
[grammar] ~29-~29: Fout gevonden
Context: ... | | | |
| 'Full lifecycle - create, configur...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~30-~30: Dit kan een fout zijn.
Context: ... ? | 0.2740 | 4464 B | ? |
| ...
(QB_NEW_NL)
[grammar] ~31-~31: Fout gevonden
Context: ... | | | |
| 'Property access - RepositoryPath&...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~32-~32: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| 'Property access - Configuration...
(QB_NEW_NL)
[grammar] ~33-~33: Zin met fouten
Context: ...| - | - | ? |
| 'Property access - Configuration' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~33-~33: Zin met fouten
Context: ... ? |
| 'Property access - Configuration' | .NET 10.0 | 0.6834...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~33-~33: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| ...
(QB_NEW_NL)
[grammar] ~34-~34: Fout gevonden
Context: ... | | | |
| 'Property access - RepositoryPath&...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~35-~35: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| 'Property access - Configuration...
(QB_NEW_NL)
[grammar] ~36-~36: Zin met fouten
Context: ...| - | - | ? |
| 'Property access - Configuration' ...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~36-~36: Zin met fouten
Context: ... ? |
| 'Property access - Configuration' | .NET 9.0 | 0.7295...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_MULTITOKEN)
[grammar] ~36-~36: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| ...
(QB_NEW_NL)
[grammar] ~37-~37: Fout gevonden
Context: ... | | | |
| 'Property modification - set all p...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~38-~38: Dit kan een fout zijn.
Context: ... ? | 0.2594 | 4120 B | ? |
| ...
(QB_NEW_NL)
[grammar] ~39-~39: Fout gevonden
Context: ... | | | |
| 'Property modification - set all p...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~40-~40: Dit kan een fout zijn.
Context: ... ? | 0.2529 | 4120 B | ? |
| ...
(QB_NEW_NL)
[grammar] ~41-~41: Fout gevonden
Context: ... | | | |
| 'ValidateOptions - valid state'...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~42-~42: Dit kan een fout zijn.
Context: ... ? | - | - | ? |
| ...
(QB_NEW_NL)
[grammar] ~43-~43: Fout gevonden
Context: ... | | | |
| 'ValidateOptions - valid state'...
(QB_NEW_NL_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
.docfx/packages/index.md
[style] ~12-~12: Using many exclamation marks might seem excessive (in this case: 6 exclamation marks for a text that’s 1317 characters long)
Context: ...s.BenchmarkDotNet.Console?logo=nuget) | 
🪛 markdownlint-cli2 (0.18.1)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.BenchmarkWorkspaceBenchmark-report-github.md
1-1: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
14-14: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkProgramBenchmark-report-github.md
1-1: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
14-14: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
README.md
15-15: Bare URL used
(MD034, no-bare-urls)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkWorkerBenchmark-report-github.md
1-1: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
14-14: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
.github/copilot-instructions.md
153-153: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
154-154: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
166-166: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
247-247: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkContextBenchmark-report-github.md
1-1: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
14-14: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🪛 YAMLlint (1.37.1)
.docfx/toc.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
.github/workflows/ci-pipeline.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: call-test (ubuntu-24.04, Debug) / 🧪 Test
- GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
- GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04, Release) / 🧪 Test
- GitHub Check: call-pack (Debug) / 📦 Pack
- GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
- GitHub Check: call-pack (Release) / 📦 Pack
- GitHub Check: call-test (windows-2025, Release) / 🧪 Test
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs
Show resolved
Hide resolved
tuning/Codebelt.Extensions.BenchmarkDotNet.Benchmarks/BenchmarkWorkspaceBenchmark.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.nuget/Codebelt.Extensions.BenchmarkDotNet/README.md(1 hunks)README.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .nuget/Codebelt.Extensions.BenchmarkDotNet/README.md
🧰 Additional context used
🪛 LanguageTool
README.md
[style] ~94-~94: Using many exclamation marks might seem excessive (in this case: 10 exclamation marks for a text that’s 3859 characters long)
Context: ...s.BenchmarkDotNet.Console?logo=nuget) | 
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04, Release) / 🧪 Test
- GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
- GitHub Check: call-test (windows-2025, Release) / 🧪 Test
- GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
- GitHub Check: call-pack (Debug) / 📦 Pack
- GitHub Check: call-test (ubuntu-24.04, Debug) / 🧪 Test
🔇 Additional comments (3)
README.md (3)
1-11: Comprehensive and consistent rebranding from ClassLibrary1 to Codebelt.Extensions.BenchmarkDotNet.The header, title, badges, and description have been thoroughly updated. Repository links, CI/CD badges, and all references now point to the new project identity. The description accurately reflects the shift to a BenchmarkDotNet companion library with MIT licensing.
13-53: Folder structure explanation and layout example are clear and well-organized.The architectural principles (tuning, tooling, reports separation) align well with the PR objectives and provide clear guidance for users. The ASCII diagram effectively visualizes the recommended repository structure.
59-81: Code example demonstrates correct usage of the library API.The BenchmarkProgram.Run() example with BenchmarkWorkspaceOptions configuration is accurate and shows proper integration with BenchmarkDotNet jobs and runtimes. The code is syntactically correct and idiomatic for .NET console hosting patterns.
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci-pipeline.yml(4 hunks)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (3)
BenchmarkWorker(16-79)BenchmarkWorker(23-25)ConfigureServices(34-37)src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
BenchmarkContext(6-22)BenchmarkContext(12-15)
🪛 YAMLlint (1.37.1)
.github/workflows/ci-pipeline.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04-arm, Release) / 🧪 Test
- GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04, Release) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04, Debug) / 🧪 Test
- GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
- GitHub Check: call-test (ubuntu-24.04-arm, Debug) / 🧪 Test
- GitHub Check: call-pack (Debug) / 📦 Pack
- GitHub Check: call-test (windows-2025, Release) / 🧪 Test
🔇 Additional comments (7)
.github/workflows/ci-pipeline.yml (5)
25-29: Verifybenchmarkdotnet.snkis available to the reusable build workflow. If the key is fetched from secrets/artifacts, ensure the new filename is referenced consistently there; otherwise signing will fail.
55-56:build: true/restore: truefor xUnit v3 dependency looks reasonable. Just ensure the reusable test workflow doesn’t already build/restore by default to avoid duplicate work.
61-66: SonarCloud org/projectKey rename: ensure the target project exists and tokens have access. Otherwise analysis will fail post-test.
68-74: Codecov repository rename: ensure Codecov is configured forcodebeltnet/benchmarkdotnet. Otherwise uploads may be rejected or attributed to the wrong repo.
45-56: All GitHub runner labels are valid.ubuntu-24.04,windows-2025,ubuntu-24.04-arm, andwindows-11-armare all supported GitHub-hosted runner labels and will schedule correctly.Likely an incorrect or invalid review comment.
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
17-22: Past null reference issue has been resolved.The null-coalescing operator
??now provides a safe fallback toAssembly.GetExecutingAssembly()whenAssembly.GetEntryAssembly()returns null, addressing the concern raised in the previous review.
24-34: LGTM!The static properties are well-documented and correctly initialized by the static constructor.
| @@ -1,4 +1,4 @@ | |||
| name: ClassLibrary1 CI Pipeline | |||
| name: BenchmarkDotNet CI Pipeline | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix YAML newline style (CRLF vs LF) to satisfy yamllint. The lint error suggests the file is committed with \r\n; normalize to \n to avoid CI noise.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 1-1: wrong new line character: expected \n
(new-lines)
🤖 Prompt for AI Agents
In .github/workflows/ci-pipeline.yml around line 1, the file currently uses CRLF
line endings which triggers yamllint; convert the file to use LF-only newlines.
Open the file in an editor or run a tool (e.g., dos2unix) or git commands (git
config core.autocrlf false; git rm --cached .github/workflows/ci-pipeline.yml;
git add --renormalize .github/workflows/ci-pipeline.yml) to normalize to \n,
commit the change, and optionally add a .gitattributes entry (*.yml text eol=lf)
to prevent future CRLF commits.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|



This pull request completes a comprehensive rebranding and restructuring of the repository from "ClassLibrary1" to "Codebelt.Extensions.BenchmarkDotNet." It updates all documentation, configuration, and project structure to reflect the new name and introduces improved, detailed guidelines for writing performance benchmarks. The solution and CI/CD pipeline have also been updated to match the new naming and organization conventions.
Key changes include:
Repository and Solution Renaming:
Replaces all references to "ClassLibrary1" with "Codebelt.Extensions.BenchmarkDotNet" across documentation, code samples, namespaces, and configuration files, ensuring consistency throughout the codebase. (
.github/copilot-instructions.md,Directory.Build.props,.github/workflows/ci-pipeline.yml) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Removes the old solution file
ClassLibrary1.slnand replaces it with a new solution structure fileCodebelt.Extensions.BenchmarkDotNet.slnx, organizing projects into/src/,/test/,/tooling/, and/tuning/folders. [1] [2]Documentation and Guidelines Updates:
Updates unit test and performance test guidelines to use the new naming, namespaces, and folder structure, providing clear examples for Codebelt.Extensions.BenchmarkDotNet. (
.github/copilot-instructions.md) [1] [2] [3] [4] [5] [6]Adds a comprehensive new prompt for Copilot on how to generate BenchmarkDotNet performance benchmarks, including naming, placement, best practices, and example fixtures. (
.github/prompts/benchmark.prompt.md)CI/CD and Build Configuration:
Updates the GitHub Actions workflow to use the new project name, secrets, and repository references, and adapts signing key and project keys for the renamed solution. (
.github/workflows/ci-pipeline.yml) [1] [2] [3] [4]Adjusts build properties and paths in
Directory.Build.propsto align with the new structure and naming conventions. [1] [2]Cleanup of Legacy Artifacts:
.nuget/ClassLibrary1/PackageReleaseNotes.txt,.nuget/ClassLibrary1/README.md) [1] [2]ClassLibrary1.sln.These updates lay the foundation for future development under the new Codebelt.Extensions.BenchmarkDotNet name, with improved organization, clearer guidelines, and modernized CI/CD processes.
Summary by CodeRabbit
New Features
Updates
Documentation
Tests & Benchmarks
✏️ Tip: You can customize this high-level summary in your review settings.