Skip to content
Merged
Show file tree
Hide file tree
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 Nov 23, 2025
a3d261c
:recycle: guard rails to ensure FowlerNollVoHash specs
gimlichael Nov 23, 2025
f7680c1
:sparkles: added copilot instructions
gimlichael Nov 23, 2025
7608649
:zap: optimized foundation for DateSpan incl. updated unit test
gimlichael Nov 23, 2025
054fc90
:white_check_mark: fixed bug in unit test
gimlichael Nov 23, 2025
37b24ac
:zap: significant optimizations for FowlerNollVoHash base class (than…
gimlichael Nov 23, 2025
6588893
:zap: optimized RandomString to be 2-3x more performant
gimlichael Nov 23, 2025
e90a69c
:white_check_mark: additional unit tests
gimlichael Nov 23, 2025
e0903d5
:chart_with_upwards_trend: first attempt to write performance test us…
gimlichael Nov 23, 2025
4a70d0e
:zap: avoid using reflection (Activator)
gimlichael Nov 25, 2025
eef6194
:zap: optimize DelimitedString handling and performance
gimlichael Nov 25, 2025
f95ab69
:fix: refactor decryption logic and update using directives
gimlichael Nov 26, 2025
b312f00
:building_construction: refine project configurations and targets
gimlichael Nov 26, 2025
d54e999
:bug: add null-check validation to computehash input
gimlichael Nov 26, 2025
324e8da
fix
gimlichael Nov 26, 2025
6fbf13a
:fix: make setup parameter optional in constructor (consistency)
gimlichael Nov 26, 2025
7df4132
:zap: optimize AES performance via TransformFinalBlock
gimlichael Nov 27, 2025
934327c
:white_check_mark: add comprehensive unit tests for cryptography
gimlichael Nov 27, 2025
92563d9
:zap: optimized crc classes for efficiency and clarity
gimlichael Nov 29, 2025
f77066c
:white_check_mark: add unit tests for crc and fnv hash algorithms
gimlichael Nov 29, 2025
74d6773
:white_check_mark: add tests for hashfactory factory methods
gimlichael Nov 29, 2025
e79edbb
:books: update testing and benchmarking copilot guidelines
gimlichael Nov 29, 2025
21062a7
:arrow_up: update xunit package versions to 3.2.1
gimlichael Nov 29, 2025
12b7242
:construction_worker: update ci pipeline for os matrix support
gimlichael Nov 29, 2025
cb33dc4
:memo: update docs for tests and benchmarks naming conventions
gimlichael Nov 29, 2025
d450cab
:sparkles: add post-configuration support for parameter objects
gimlichael Dec 6, 2025
ce113e8
:white_check_mark: update test assertion for configurationTypesCount
gimlichael Dec 6, 2025
4d12ffc
:package: updated NuGet package definition
gimlichael Dec 6, 2025
bdd450c
chore
gimlichael Dec 6, 2025
feec99d
:speech_balloon: updated community health pages
gimlichael Dec 6, 2025
7e3948c
:arrow_up: bump dependencies
gimlichael Dec 6, 2025
7f2f009
ai
gimlichael Dec 6, 2025
83fde7e
fixes
gimlichael Dec 6, 2025
13bc4d9
:alembic: early stages of support for benchmarkdotnet on select free …
gimlichael Dec 6, 2025
27a9d0e
dependencies
gimlichael Dec 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
583 changes: 583 additions & 0 deletions .github/copilot-instructions.md

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions .github/prompts/benchmark.prompt.md
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.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Cuemon CI/CD Pipeline
on:
pull_request:
branches: [main]
paths-ignore:
- .codecov/**
- .docfx/**
- .nuget/**
- '**/*.md'
workflow_dispatch:
inputs:
configuration:
Expand Down Expand Up @@ -73,11 +68,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: ubuntu-24.04
runs-on: ${{ matrix.os }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
build: true # we need to build due to xUnitv3
Expand All @@ -89,11 +85,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2025, windows-11-arm]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: windows-2022
runs-on: ${{ matrix.os }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
test-arguments: -- RunConfiguration.DisableAppDomain=true
Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.AspNetCore.App/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.AspNetCore.Mvc/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.AspNetCore/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.Core.App/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
20 changes: 20 additions & 0 deletions .nuget/Cuemon.Core/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

# New Features
- ADDED IPostConfigurableParameterObject interface in the Cuemon.Configuration namespace that defines a contract for parameter objects that require post-configuration logic

# Improvements
- EXTENDED Validator class in the Cuemon namespace to support invoking parameter objects implementing the IPostConfigurableParameterObject interface
- OPTIMIZED FowlerNollVoHash class in the Cuemon.Security namespace for better performance when computing hash codes
- OPTIMIZED DateSpan struct in the Cuemon namespace for better performance when computing hash codes and equality checks
- OPTIMIZED RandomString method on the Generate class in the Cuemon namespace with a sequential char-array builder and length guard, reducing overhead and allocations
- OPTIMIZED DelimitedString class in the Cuemon namespace with a specialized fast-path for single-character delimiters and qualifiers, reducing overhead and allocations
- OPTIMIZED CyclicRedundancyCheck class in the Cuemon.Security namespace switching CRC lookup tables to ulong[] and simplified initialization/loop structure, increasing throughput and reducing unnecessary copying

# Bug Fixes
- FIXED Patterns class in the Cuemon namespace to use generic object creation expressions to eliminate reflection overhead

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.Data.Integrity/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.Data.SqlClient/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.Data/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
6 changes: 6 additions & 0 deletions .nuget/Cuemon.Diagnostics/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 10.1.0
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version 10.0.0
Availability: .NET 10 and .NET 9

Expand Down
Loading
Loading