StackPractices

performance

Practical resources about performance for software engineers.

103 results

Optimizing for Speed and Efficiency

Performance is a feature. Slow applications lose users, increase infrastructure costs, and create a poor developer experience. Profiling, benchmarking, and systematic optimization are essential skills for senior engineers.

This section covers profiling techniques, database query optimization, frontend bundle analysis, memory leak detection, and latency reduction strategies. Each guide includes measurable targets and before/after benchmarks.

intermediate

Concurrent Async Tasks with asyncio.gather and Task Groups

Execute multiple async operations concurrently in Python using asyncio.gather, asyncio.TaskGroup,...

intermediate

asyncio.Semaphore: Limit Concurrent API Calls in Python

Use asyncio.Semaphore in Python to cap concurrent API calls, database queries, and resource access...

intermediate

Parallelize CPU and I/O Work with ThreadPoolExecutor

Use Python's ThreadPoolExecutor for parallel I/O operations, thread-safe result collection, Future...

intermediate

Build Async Systems with Rust Tokio Runtime

Build async systems in Rust using the Tokio runtime with tasks, channels, select, synchronization...

intermediate

Caching & Memoization in Python, JavaScript, and Java

How to cache expensive computations and API responses using in-memory LRU, TTL, and distributed...

intermediate

PostgreSQL Query Optimization and Indexing Strategies

Analyze and optimize slow PostgreSQL queries using EXPLAIN, proper indexing, partial indexes, and...

intermediate

Redis Cache Patterns for High-Performance Applications

How to implement cache-aside, write-through, and write-behind patterns with Redis to reduce...

intermediate

Read Large Files in Node.js with Streams (5GB in 64KB RAM)

Process GB-sized files in Node.js with createReadStream, readline, Transform pipelines, and...

intermediate

Debounce and Throttle Functions in JavaScript

Control function execution rate with debounce and throttle. Covers leading and trailing edge,...

javascript debounce throttle performance
intermediate

Batch and Cache Database Queries with GraphQL DataLoader

Use DataLoader to coalesce individual load requests into batched database calls, solving the N+1...

intermediate

Detect and Fix N+1 Queries in GraphQL Resolvers

Identify N+1 query problems in GraphQL resolvers using logging, DataLoader, and query analysis...

intermediate

Distribute Background Tasks with Python Celery and Redis

Set up Celery with Redis broker for distributed task processing including task chaining, groups,...

beginner

Enable Brotli Compression in Nginx for Static Assets

Configure Brotli compression in Nginx to shrink JavaScript, CSS, and HTML assets with better ratios...

intermediate

Implement Cache Invalidation Strategies

How to keep caches consistent with databases using TTL, write-through, write-behind, and...

intermediate

Caching Strategies: Browser, CDN, Redis & Database

Implement effective caching at every layer of the stack: browser cache, CDN edge, Redis application...

intermediate

CDN Edge Caching: Cloudflare, CloudFront, Fastly

Configure edge caching rules on Cloudflare, AWS CloudFront, and Fastly: TTL policies, cache keys,...

intermediate

Set Up Connection Pooling for Databases and HTTP Clients

Set up connection pooling for PostgreSQL, MySQL, Redis, and HTTP clients in Python, JavaScript, and...

intermediate

Optimize Queries with Database Indexing

How to create, analyze, and maintain indexes to speed up database queries and avoid common indexing...

intermediate

Debounce and Throttle

How to implement debounce and throttle patterns to control function execution frequency for search...

debounce throttle events optimization
beginner

Implement Lazy Loading for Images, Components, and Data

How to defer loading of non-critical resources until they are needed, improving initial page load...

No results found.