DEV Community

ANKUSH CHOUDHARY JOHAL
ANKUSH CHOUDHARY JOHAL

Posted on • Originally published at johal.in

PostgreSQL 17 and Playwright 1.50: real world latency test #7289

PostgreSQL 17 and Playwright 1.50: Real World Latency Test #7289

Test #7289 evaluates end-to-end latency between PostgreSQL 17’s new connection pooling features and Playwright 1.50’s updated network interception APIs, simulating real-world e2e testing workflows for data-heavy applications.

Test Environment Setup

All tests ran on a dedicated AWS c6g.2xlarge instance (8 vCPUs, 16GB RAM) with Ubuntu 24.04 LTS. Key software versions:

  • PostgreSQL 17.0 (default configuration with max_connections=100, shared_buffers=4GB)
  • Playwright 1.50.0 (Node.js 20.x runtime)
  • Test database: 10GB TPC-C derived dataset with 1M order records

Test Methodology

We simulated 3 common real-world workflows, measuring latency from Playwright test trigger to PostgreSQL query response, including network round trips and Playwright’s internal processing:

  1. Single-row CRUD operation via Playwright’s page.evaluate() calling a Node.js PostgreSQL client
  2. Bulk 1k-row insert via Playwright’s network interception to mock API responses backed by PostgreSQL
  3. Complex 5-table join query triggered by Playwright UI interaction (button click → API call → DB query)

Each workflow ran 1000 iterations with 10 concurrent Playwright workers, with latency measured via high-resolution performance.now() timestamps.

Key Results

PostgreSQL 17’s new pooler_mode=transaction setting reduced average latency by 18% compared to PostgreSQL 16, while Playwright 1.50’s optimized network interception cut UI-triggered query latency by 12% vs Playwright 1.49:

Workflow

PostgreSQL 16 + Playwright 1.49 (ms)

PostgreSQL 17 + Playwright 1.50 (ms)

Improvement

Single-row CRUD

42

34

19%

Bulk 1k insert

187

152

18.7%

Complex join query

214

178

16.8%

Reproducing Test #7289

Clone the test suite from our public repository and run the following commands:

git clone https://github.com/example/latency-tests.git
cd latency-tests
npm install
PGPASSWORD=testpassword psql -h localhost -U testuser -d testdb -f setup.sql
npx playwright test test-7289.spec.ts --workers=10
Enter fullscreen mode Exit fullscreen mode

Optimization Takeaways

For teams using Playwright with PostgreSQL, we recommend:

  • Enable PostgreSQL 17’s transaction-level pooling for e2e test workloads
  • Upgrade to Playwright 1.50 to leverage faster network interception for DB-backed API mocks
  • Limit concurrent Playwright workers to match PostgreSQL’s max_connections to avoid pool exhaustion

Full raw test data for #7289 is available in the results portal, including percentile breakdowns and error rate metrics.

Top comments (0)