debugging

HTTPtrace to debug DNS/connect/TLS timing in production-like runs

When an outbound call is slow, it’s not always the server—it can be DNS, connection reuse, or TLS handshakes. net/http/httptrace lets you instrument a single request and see exactly where time is going. I attach a trace to the request context and reco

Query debugging and troubleshooting techniques

Query debugging identifies performance and correctness issues. I use EXPLAIN ANALYZE to understand execution plans. Slow query logs reveal problematic queries. pgstatstatements tracks query statistics. Understanding sequential scans vs index scans hel

Instruments and performance profiling

Instruments profiles iOS apps to identify performance bottlenecks, memory leaks, and energy issues. The Time Profiler instrument samples the call stack to show which functions consume CPU time. Allocations tracks memory usage and finds leaks by identi

Django debug toolbar for development

Django Debug Toolbar reveals query counts, cache hits, and template rendering time. I add it only in development settings. The toolbar shows all SQL queries which helps identify N+1 problems. I use the profiler panel to find slow code. The cache panel

cargo-expand to inspect macro expansions

cargo expand is a subcommand that shows the output of macro expansion. It's invaluable for debugging derive macros, understanding what declarative macros produce, or learning how async functions desugar. I run cargo expand --lib to see the entire crat

Error handling and debugging techniques in JavaScript

JavaScript error handling uses try...catch...finally blocks to manage exceptions gracefully. I throw custom errors with throw new Error('message') for better debugging. The finally block runs regardless of success or failure. Using console.error(), co