A performance analysis of 12 web stacks across eight programming languages (PHP, Go, Node.js, Rust, Java, .NET, Python, and Ruby) revealed that database driver behavior significantly impacts CPU usage. The study measured CPU time per request for a JSON API performing four SQL queries per page, using both PostgreSQL and MySQL.

On PostgreSQL, performance is primarily determined by whether the database driver caches prepared statements by default. Drivers that reuse these statements, such as pgx for Go, PgJDBC for Java, and asyncpg for Python, resulted in PostgreSQL spending approximately 0.5 ms per request. Conversely, drivers that re-parse every query caused the database to spend 1.2–1.5 ms per request.

For MySQL, the performance gap between drivers is less pronounced because most drivers send queries as plain text. In this scenario, the CPU efficiency of the web stack itself becomes more apparent. Swoole and FrankenPHP showed high efficiency, while .NET's performance was influenced by its thread pool configuration, which can be tuned to reduce idle CPU consumption.

The study also evaluated memory consumption under high-latency conditions, simulating external service delays. RoadRunner exhibited higher memory overhead due to its process-based execution model, while stacks like Swoole, Go, Rust, and Python demonstrated lower memory growth per 1,000 concurrent requests.

Financial modeling based on AWS EC2 pricing suggests that optimizing database driver settings—such as enabling prepared statement caching or using tools like PgBouncer—can reduce monthly infrastructure costs more effectively than switching between different web execution models.