惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
F
Fortinet All Blogs
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
MyScale Blog
MyScale Blog
B
Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
IT之家
IT之家
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
博客园_首页
L
LangChain Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky

The Practical Developer

The Libuv Thread Pool Trap: Why Node.js Async APIs Stall Under Load Postgres Covering Indexes with INCLUDE: Eliminate Heap Fetches on Read-Heavy Workloads Postgres DISTINCT ON: The Fastest Way to Get the Latest Row Per Group Postgres Transaction Isolation: The Anomalies Your App Actually Faces in Production Linux TCP Tuning for Node.js Microservices: The Kernel Settings That Stop Silent Connection Drops Under Load Postgres HOT Updates and Fillfactor: Why Not All Writes Are Created Equal Database Connection Pool Leaks: Finding the Promise That Never Returns Its Seat Linux OOM Killer in Production: Why Your Node.js Containers Die Without a Stack Trace Postgres Materialized Views: Refresh Strategies That Do Not Lock Your Dashboards API Dependency Health Checks: Why /health Is Not Enough Authorization with Zanzibar Tuples: How Google Manages Permissions and How To Build the Same Check in Node.js Postgres Advisory Locks: The 20-Character Primitive That Replaces Redis for Coordination Dead Letter Queues: The Message Queue Pattern That Saves You at 2 a.m. File Descriptor Exhaustion: The Kernel Limit That Silently Drops Node.js Connections Graceful Degradation: The Pattern That Turns Total Outages into Partial Success PostgreSQL Full-Text Search: Dropping Elasticsearch for 90% of Use Cases S3 Presigned Multipart Uploads: Stop Your API Server from Being a File Upload Bottleneck MessagePack vs JSON: The Binary Serialization Switch That Cut Our Internal RPC Overhead by 40% DNS Caching in Node.js: The Silent Cause of Production Latency Spikes Reliable Cron Jobs: The Pattern That Stops Double Runs, Missed Executions, And The 2 AM Page GraphQL Query Complexity: Stop the OOM Query Before It Reaches Your Resolver Node.js Event Loop Lag: The Hidden Metric Behind Random Latency Spikes API Request Validation with Zod: The Schema That Catches Bad Input Before It Corrupts Your Database Load Shedding in Node.js: How to Reject Traffic Before You Drown Request Hedging: Cut Tail Latency In Half Without Overprovisioning Git Bisect: The Automated Binary Search That Finds Breaking Commits in Minutes Node.js Garbage Collection Tuning: Stop Letting V8 Pause Your Event Loop Node.js Server Timeouts: The Settings That Stop Slow Clients from Holding Sockets Hostage Postgres BRIN Indexes: The Time-Series Secret That Shrinks Indexes by 99% Event Sourcing with PostgreSQL: The Pragmatic 80% Solution
Stop Fighting Your Debugger: 10 Tricks That Actually Save...
The Practica · 2025-02-01 · via The Practical Developer

Every developer has a debugging style. Most of them are slower than they need to be. Here are the techniques worth learning.

1. Conditional breakpoints

Right-click a breakpoint in VS Code → “Edit Breakpoint” → add a condition like user.id === 42. The debugger only stops when that expression is truthy. This is 10× faster than hitting a breakpoint 200 times in a loop.

2. Logpoints (no code changes required)

In VS Code: right-click gutter → “Add Logpoint”. Enter an expression like "user: {user.id}". It prints to the debug console without modifying your source. Your coworkers won’t see a stray console.log in the PR.

3. The debugger statement in production builds

Sometimes you need to break in a deployed app with no source maps. Add debugger; to the source, open DevTools before loading, and the browser will pause there. Remove it before committing. Set up a lint rule to catch it.

4. Watch expressions

Add expressions to the Watch panel (user.permissions.length, response.status). They update on every step. Stop rechecking the same variables manually.

5. console.table for arrays of objects

console.table(users); // renders a sortable table in DevTools

Better than console.log(users) for anything with more than 3 fields.

6. Step Into vs Step Over (actually understand the difference)

  • Step Over (F10): runs the current line, doesn’t enter function calls
  • Step Into (F11): follows execution into the next function call
  • Step Out (Shift+F11): runs to the end of the current function and pauses in the caller

Most devs hammer F10 and miss where the bug actually lives.

7. The Call Stack panel is your friend

When you hit a breakpoint, look at the Call Stack. Click any frame to jump to that context. This is how you answer “how did we get here?” without reading 10 files.

8. Source map tricks

If minified code is your nemesis: DevTools → Settings → “Enable source maps”. For Node, run with --enable-source-maps. If source maps aren’t loading, check that your build config outputs them and your server serves .map files.

9. performance.mark for timing

performance.mark('render-start');
doExpensiveRender();
performance.mark('render-end');
performance.measure('render', 'render-start', 'render-end');
console.log(performance.getEntriesByName('render')[0].duration);

More accurate than console.time and shows up in the Performance panel timeline.

10. Reproduce it in isolation

The best debugging trick: shrink the reproduction. Copy the failing code to a new file, remove everything not related to the bug. You’ll often find the issue just by doing this. When you don’t, you have a minimal repro you can share or post for help.


The single biggest upgrade: switch from “add console.logs until I find it” to “set a breakpoint at the entry point and step through.” It feels slower at first. It’s 3× faster after one week.