-
Notifications
You must be signed in to change notification settings - Fork 5
V10.1.0/api improvements and features #134
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
e9986a6
:zap: FNV performance boost for bit sizes greater than 128; modest op…
gimlichael a3d261c
:recycle: guard rails to ensure FowlerNollVoHash specs
gimlichael f7680c1
:sparkles: added copilot instructions
gimlichael 7608649
:zap: optimized foundation for DateSpan incl. updated unit test
gimlichael 054fc90
:white_check_mark: fixed bug in unit test
gimlichael 37b24ac
:zap: significant optimizations for FowlerNollVoHash base class (than…
gimlichael 6588893
:zap: optimized RandomString to be 2-3x more performant
gimlichael e90a69c
:white_check_mark: additional unit tests
gimlichael e0903d5
:chart_with_upwards_trend: first attempt to write performance test us…
gimlichael 4a70d0e
:zap: avoid using reflection (Activator)
gimlichael eef6194
:zap: optimize DelimitedString handling and performance
gimlichael f95ab69
:fix: refactor decryption logic and update using directives
gimlichael b312f00
:building_construction: refine project configurations and targets
gimlichael d54e999
:bug: add null-check validation to computehash input
gimlichael 324e8da
fix
gimlichael 6fbf13a
:fix: make setup parameter optional in constructor (consistency)
gimlichael 7df4132
:zap: optimize AES performance via TransformFinalBlock
gimlichael 934327c
:white_check_mark: add comprehensive unit tests for cryptography
gimlichael 92563d9
:zap: optimized crc classes for efficiency and clarity
gimlichael f77066c
:white_check_mark: add unit tests for crc and fnv hash algorithms
gimlichael 74d6773
:white_check_mark: add tests for hashfactory factory methods
gimlichael e79edbb
:books: update testing and benchmarking copilot guidelines
gimlichael 21062a7
:arrow_up: update xunit package versions to 3.2.1
gimlichael 12b7242
:construction_worker: update ci pipeline for os matrix support
gimlichael cb33dc4
:memo: update docs for tests and benchmarks naming conventions
gimlichael d450cab
:sparkles: add post-configuration support for parameter objects
gimlichael ce113e8
:white_check_mark: update test assertion for configurationTypesCount
gimlichael 4d12ffc
:package: updated NuGet package definition
gimlichael bdd450c
chore
gimlichael feec99d
:speech_balloon: updated community health pages
gimlichael 7e3948c
:arrow_up: bump dependencies
gimlichael 7f2f009
ai
gimlichael 83fde7e
fixes
gimlichael 13bc4d9
:alembic: early stages of support for benchmarkdotnet on select free …
gimlichael 27a9d0e
dependencies
gimlichael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| --- | ||
| mode: agent | ||
| description: 'Writing Performance Benchmarks in Cuemon' | ||
| --- | ||
|
|
||
| # Benchmark Fixture Prompt (Cuemon Tuning Benchmarks) | ||
|
|
||
| This prompt defines how to generate performance tests (“benchmarks”) for the Cuemon codebase using BenchmarkDotNet. | ||
| Benchmarks in Cuemon are *not* unit tests — they are micro- or component-level performance measurements that belong under the `tuning/` directory and follow strict conventions. | ||
|
|
||
| Copilot must follow these guidelines when generating benchmark fixtures. | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Naming and Placement | ||
|
|
||
| - All benchmark projects live under the `tuning/` folder. | ||
| Examples: | ||
| - `tuning/Cuemon.Core.Benchmarks/` | ||
| - `tuning/Cuemon.Security.Benchmarks/` | ||
|
|
||
| - **Namespaces must NOT end with `.Benchmarks`.** | ||
| They must mirror the production assembly’s namespace. | ||
|
|
||
| Example: | ||
| If benchmarking a type inside `Cuemon.Security.Cryptography`, then: | ||
|
|
||
| ```csharp | ||
| namespace Cuemon.Security.Cryptography | ||
| { | ||
| public class Sha512256Benchmark { … } | ||
| } | ||
| ``` | ||
|
|
||
| * **Benchmark class names must end with `Benchmark`.** | ||
| Example: `DateSpanBenchmark`, `FowlerNollVoBenchmark`. | ||
|
|
||
| * Benchmark files should be located in the matching benchmark project | ||
| (e.g., benchmarks for `Cuemon.Security.Cryptography` go in `Cuemon.Security.Cryptography.Benchmarks.csproj`). | ||
|
|
||
| * In the `.csproj` for each benchmark project, set the root namespace to the production namespace: | ||
|
|
||
| ```xml | ||
| <RootNamespace>Cuemon.Security.Cryptography</RootNamespace> | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Attributes and Configuration | ||
|
|
||
| Each benchmark class should use: | ||
|
|
||
| ```csharp | ||
| [MemoryDiagnoser] | ||
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | ||
| ``` | ||
|
|
||
| Optional but strongly recommended where meaningful: | ||
|
|
||
| * `[Params(...)]` — define small, medium, large input sizes. | ||
| * `[GlobalSetup]` — deterministic initialization of benchmark data. | ||
| * `[Benchmark(Description = "...")]` — always add descriptions. | ||
| * `[Benchmark(Baseline = true)]` — when comparing two implementations. | ||
|
|
||
| Avoid complex global configs; prefer explicit attributes inside the class. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Structure and Best Practices | ||
|
|
||
| A benchmark fixture must: | ||
|
|
||
| * Measure a **single logical operation** per benchmark method. | ||
| * Avoid I/O, networking, disk access, logging, or side effects. | ||
| * Avoid expensive setup inside `[Benchmark]` methods. | ||
| * Use deterministic data (e.g., seeded RNG or predefined constants). | ||
| * Use `[GlobalSetup]` to allocate buffers, random payloads, or reusable test data only once. | ||
| * Avoid shared mutable state unless reset per iteration. | ||
|
|
||
| Use representative input sizes such as: | ||
|
|
||
| ```csharp | ||
| [Params(8, 256, 4096)] | ||
| public int Count { get; set; } | ||
| ``` | ||
|
|
||
| BenchmarkDotNet will run each benchmark for each parameter value. | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Method Naming Conventions | ||
|
|
||
| Use descriptive names that communicate intent: | ||
|
|
||
| * `Parse_Short` | ||
| * `Parse_Long` | ||
| * `ComputeHash_Small` | ||
| * `ComputeHash_Large` | ||
| * `Serialize_Optimized` | ||
| * `Serialize_Baseline` | ||
|
|
||
| When comparing approaches, always list them clearly and tag one as the baseline. | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Example Benchmark Fixture | ||
|
|
||
| ```csharp | ||
| using BenchmarkDotNet.Attributes; | ||
| using BenchmarkDotNet.Configs; | ||
|
|
||
| namespace Cuemon | ||
| { | ||
| [MemoryDiagnoser] | ||
| [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] | ||
| public class SampleOperationBenchmark | ||
| { | ||
| [Params(8, 256, 4096)] | ||
| public int Count { get; set; } | ||
|
|
||
| private byte[] _payload; | ||
|
|
||
| [GlobalSetup] | ||
| public void Setup() | ||
| { | ||
| _payload = new byte[Count]; | ||
| // deterministic initialization | ||
| } | ||
|
|
||
| [Benchmark(Baseline = true, Description = "Operation - baseline")] | ||
| public int Operation_Baseline() => SampleOperation.Process(_payload); | ||
|
|
||
| [Benchmark(Description = "Operation - optimized")] | ||
| public int Operation_Optimized() => SampleOperation.ProcessOptimized(_payload); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 6. Reporting and CI | ||
|
|
||
| * Benchmark projects live exclusively under `tuning/`. They must not affect production builds. | ||
| * Heavy BenchmarkDotNet runs should *not* run in CI unless explicitly configured. | ||
| * Reports are produced by the Cuemon benchmark runner and stored under its configured artifacts directory. | ||
|
|
||
| --- | ||
|
|
||
| ## 7. Additional Guidelines | ||
|
|
||
| * Keep benchmark fixtures focused and readable. | ||
| * Document non-obvious reasoning in short comments. | ||
| * Prefer realistic but deterministic data sets. | ||
| * When benchmarks reveal regressions or improvements, reference the associated PR or issue in a comment. | ||
| * Shared benchmark helpers belong in `tuning/` projects, not in production code. | ||
|
|
||
| --- | ||
|
|
||
| ## Final Notes | ||
|
|
||
| * Benchmarks are performance tests, not unit tests. | ||
| * Use `[Benchmark]` only for pure performance measurement. | ||
| * Avoid `MethodImplOptions.NoInlining` unless absolutely necessary. | ||
| * Use small sets of meaningful benchmark scenarios — avoid combinatorial explosion. | ||
|
|
||
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
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.AspNetCore.Authentication/PackageReleaseNotes.txt
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
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.AspNetCore.Razor.TagHelpers/PackageReleaseNotes.txt
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
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
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
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
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
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
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
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Authentication/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Mvc.RazorPages/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Mvc/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Text.Json/PackageReleaseNotes.txt
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
6 changes: 6 additions & 0 deletions
6
.nuget/Cuemon.Extensions.AspNetCore.Xml/PackageReleaseNotes.txt
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.