Tips tagged with "Performance"

Browse all tips tagged with Performance.
shape
shape
shape
shape
shape
shape
shape
shape

PHP Hard

Bloom Filters in Practice: How They Work, False Positive Math, Sizing, PHP and Redis

Skip millions of database lookups with a few MB of bits. How Bloom filters work, the false positive math, sizing, PHP code and Redis BF commands.

PHP 8.4 Redis 8.0 Python 3.12
Diagram Try the challenge
10 min Read tip
PHP Medium

PHP Generators for Memory-Efficient Processing: yield, yield from, send() and LazyCollection

Stream a 2 GB CSV in 2 MB of RAM. How PHP generators work: yield with keys, yield from, send(), Laravel LazyCollection, cursor vs lazyById.

PHP 8.4 Laravel 13
Diagram Try the challenge
11 min Read tip
JavaScript Medium

Promise.all vs allSettled vs race vs any: Semantics, Error Handling, Timeouts and Concurrency Limits

One flaky service took down a whole dashboard through Promise.all. Learn what each combinator really does, how to add timeouts, and how to cap concurrency.

Node.js 22 TypeScript 5.9
Diagram Try the challenge
10 min Read tip
Next.js Medium

Next.js App Router Caching: fetch Cache, revalidate, ISR, revalidateTag and updateTag

Stale prices and leaked user data both come from misunderstood caching. Learn the Next.js layers, ISR, tags, updateTag vs revalidateTag, and when a route goes dynamic.

Next.js 16 React 19 Node.js 22
Diagram Try the challenge
10 min Read tip
Database Medium

Offset vs Cursor Pagination: Why Page 4,000 Is Slow and How Keyset Queries Fix It

OFFSET makes deep pages slow and shuffles rows when data changes. Learn keyset queries, composite cursors, Laravel cursorPaginate and cursor-based API design.

Laravel 13 PHP 8.4 Mysql 8.4
Diagram Try the challenge
11 min Read tip
JavaScript Medium

JavaScript Event Loop: Microtasks vs Macrotasks, Predicting Output Order, and Starving the Loop

Sync code, then all microtasks, then one macrotask. Use that rule to predict Promise vs setTimeout order and to stop async loops from freezing Node.

Node.js 22 Ecmascript 2024
Diagram Try the challenge
11 min Read tip
DevOps Medium

Circuit Breaker Pattern: Stop Hammering a Service That Is Already Down

Retries alone can bury a struggling dependency. Learn how a circuit breaker fails fast, lets the service recover and probes it safely, with PHP, Python and Laravel code.

PHP 8.4 Python 3.12
Diagram Try the challenge
6 min Read tip
JavaScript Medium

Debounce vs Throttle in JavaScript: Control How Often Code Runs

Scroll, resize, and keystroke events fire dozens of times a second. Learn how debounce and throttle rate-limit them — and which one to reach for.

JavaScript ES6+
Diagram
2 min Read tip
Database Medium

Database Indexes: Turn a Full Scan Into an Instant Lookup

See why a query without an index scans every row, how an index turns it into a fast lookup, and how to read EXPLAIN to tell the difference.

SQL ANSI / MySQL 8+
Diagram
2 min Read tip
PHP Easy

Preventing SQL Injection in PHP

Learn essential techniques to protect your PHP applications from SQL injection attacks.

PHP 8.0+
Diagram
2 min Read tip
DevOps Medium

Docker Multi-Stage Builds for Smaller Images

Reduce your Docker image size dramatically using multi-stage builds.

Docker 20.10+
Diagram
2 min Read tip
JavaScript Easy

JavaScript Async/Await Best Practices

Master async/await in JavaScript with these best practices and common pitfalls to avoid.

JavaScript ES2017+
Diagram
1 min Read tip