How to Make PostgreSQL Ridiculously Slow?

2025-07-28
How to Make PostgreSQL Ridiculously Slow?

This article challenges the reader to make PostgreSQL as slow as possible by tweaking parameters in the `postgresql.conf` file, without resorting to CPU throttling or index deletion. Through a series of carefully chosen adjustments, including drastically reducing the buffer cache size (`shared_buffers`), aggressively triggering autovacuum and analyze (`autovacuum_*` parameters), and configuring WAL (`wal_*` parameters) for maximal write frequency and I/O contention, the author manages to reduce PostgreSQL's TPS by over 7000 times, from 7000+ to below single digits, even under 0.1 TPS. The author details the rationale and impact of each parameter change and provides a reproducible configuration. This is a fascinating experiment showcasing the profound impact of database parameter tuning.

Read more
Development Parameter Tuning

JavaScript Benchmarking: A Mess of JIT Compilers, Engine Differences, and Timing Inaccuracies

2024-12-24
JavaScript Benchmarking: A Mess of JIT Compilers, Engine Differences, and Timing Inaccuracies

Benchmarking JavaScript performance is notoriously difficult. This article highlights the challenges: the JIT compiler's dynamic optimizations lead to wildly varying results across runs; different JavaScript engines (like V8 and JavaScriptCore) exhibit significant performance disparities, with identical code performing dramatically differently; and browsers intentionally reduce timing accuracy to mitigate timing attacks, making precise measurements difficult. The author suggests using tools like d8 on the server-side for greater control over optimization levels and garbage collection, while browser-side testing relies heavily on the limited information provided by developer tools. In short, JavaScript benchmarking requires careful consideration of JIT compilation, engine variations, and timing precision, making it significantly more complex than in other languages.

Read more