Worker Scheduling Benchmark

.NET 10 console app benchmarking two worker scheduling strategies — measuring the real cost of over-polling in database reads, execution time, CPU, and memory across 2,000 records.

A focused engineering experiment: does scheduling frequency matter when the workload is identical? This .NET 10 benchmark quantifies the real overhead of running the same database operation once a day vs. every minute — 1,440 times more often.

What It Tests

Worker Schedule Strategy
OnceDailyWorker Once per day Bulk-update all expired subscriptions in one operation
EveryMinuteWorker Every minute (1,440×/day) Same logic, repeated to simulate a polling pattern

Both workers produce identical results. The benchmark isolates the pure cost of scheduling overhead.

Benchmark Design

  • Seeds 2,000 counsellors and subscriptions (~20% expired) into a local SQLite database
  • Runs both workers across 3 rounds with different latency and memory measurement conditions
  • Custom SqlCounterInterceptor counts SELECTs/UPDATEs and injects simulated latency
Round Latency Memory Measurement
Round 1 0ms (local baseline) Net heap delta
Round 2 1ms simulated per DB call Net heap delta
Round 3 0ms Total allocated bytes (GC-aware)

Tech Stack

C# .NET 10 EF Core SQLite BenchmarkDotNet