Skip to content

Add Benchmark Project with BenchmarkDotNet - #10

Closed
chanido with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-9
Closed

chanido with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-9

Conversation

Copilot AI commented Sep 20, 2025 •

Copy link
Copy Markdown

This PR adds a comprehensive benchmarking project BlitzCache.Benchmarks to measure and compare BlitzCache's performance against other popular caching solutions (MemoryCache, LazyCache) under concurrent scenarios.

What's Added

New BlitzCache.Benchmarks Project

  • Console application targeting .NET 8.0
  • Integrated with BenchmarkDotNet for professional performance measurement
  • Added to the solution file with proper project references

Comprehensive Benchmark Suite

The benchmarks focus on BlitzCache's core strength - preventing the thundering herd problem:

  1. Concurrent Same Key Benchmark - Tests 100 concurrent threads accessing the same cache key:

    // BlitzCache: Single execution, all threads wait for result ⚡
    // MemoryCache: Multiple executions due to race conditions 💸
    // LazyCache: Similar to BlitzCache but different performance characteristics
  2. Concurrent Different Keys Benchmark - Baseline performance with 50 threads accessing different keys

  3. Cache Expiration Benchmark - Performance evaluation during cache refresh cycles

Documentation & Usage

  • Updated main README with benchmark section and usage instructions
  • Comprehensive benchmark project README with customization guide
  • Validation script for easy testing and verification

Key Technical Features

  • Memory diagnostics enabled to track allocation patterns
  • Proper resource disposal for all caching libraries
  • Configurable parameters for different test scenarios
  • Release mode optimization for accurate measurements
  • Simple functionality tests to verify all libraries work correctly

Performance Insights

The benchmarks demonstrate BlitzCache's unique value proposition in high-concurrency scenarios where multiple threads simultaneously request expensive operations. This provides measurable evidence of BlitzCache's effectiveness in preventing duplicate work and reducing system load.

Run the benchmarks with:

cd BlitzCache.Benchmarks
dotnet run -c Release

Fixes #9.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI commented Sep 20, 2025

Copy link
Copy Markdown
Author

@chanido 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@chanido
chanido marked this pull request as ready for review September 20, 2025 04:52
Copilot AI review requested due to automatic review settings September 20, 2025 04:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI and others added 2 commits September 20, 2025 04:53
Co-authored-by: chanido <3753931+chanido@users.noreply.github.com>
Co-authored-by: chanido <3753931+chanido@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Benchmark Project with BenchmarkDotNet Add Benchmark Project with BenchmarkDotNet Sep 20, 2025
Copilot AI requested a review from chanido September 20, 2025 04:59
@chanido chanido closed this Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Benchmark Project with BenchmarkDotNet

4 participants