A Span<T> cannot cross an await boundary

Keep span work between awaits. Carry memory or its backing buffer through asynchronous I/O.

September 29, 2026 · 2 min · Lukas Walter

Store a source checksum to skip unchanged documents

Compare a document’s source checksum, metadata, and ingestion profile before repeating extraction, chunking, embedding, and index writes.

September 4, 2026 · 4 min · Lukas Walter

Use FrozenDictionary for stable, read-heavy lookup data

Build stable lookup tables once with FrozenDictionary, reuse them across reads, and measure whether lookup savings justify the construction cost.

August 30, 2026 · 2 min · Lukas Walter

Use streaming for large or frequent uploads

Use MultipartReader when buffered ASP.NET Core uploads put too much pressure on memory, temporary-disk capacity, or disk I/O.

July 29, 2026 · 3 min · Lukas Walter

Use async for I/O, not as a substitute for CPU parallelism

Use async to avoid blocking while I/O is in flight, and treat CPU parallelism as a separate measured design decision.

July 28, 2026 · 3 min · Lukas Walter

Project EF Core queries before materializing

Use Select to project only the required values before ToListAsync, reducing transferred columns and unnecessary entity materialization on EF Core read paths.

July 26, 2026 · 2 min · Lukas Walter

AsNoTracking belongs on read paths

Skip EF Core change tracking for queries that only read entity data, but keep tracking for load-change-save updates.

July 12, 2026 · 2 min · Lukas Walter

Use ValueTask only when you know why

Prefer Task unless you have a measured allocation reason and a simple consumption contract.

July 11, 2026 · 2 min · Lukas Walter

Avoid hidden allocations in hot paths

Watch for small per-item allocations inside loops, parsers, serializers, and request paths.

July 5, 2026 · 2 min · Lukas Walter

Measure before you optimize

Use traces, counters, profiles, and focused benchmarks before changing code for performance.

July 5, 2026 · 2 min · Lukas Walter