Eliminate heap allocations when parsing strings by using Span
Tag: best-practices
Tips and Tricks #161: Use Span
Tips and Tricks #160: Implement Retry Logic for LLM API Calls
Handle rate limits and transient failures gracefully with exponential backoff.
Tips and Tricks #159: Cache LLM Responses for Cost Reduction
Implement semantic caching to avoid redundant LLM calls and reduce API costs.
Tips and Tricks #133: Use Generators for Memory-Efficient Data Processing
Process large datasets without loading everything into memory using Python generators.
Tips and Tricks #132: Freeze Collections for Thread-Safe Read Access
Use FrozenDictionary and FrozenSet for immutable, highly-optimized read-only collections.
Tips and Tricks #131: Use ValueTask for Hot Async Paths
Replace Task with ValueTask in frequently-called async methods that often complete synchronously.