Tips tagged with "Performance"

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

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