Mon Oct 30 15:10:48 2017

PostgreSQL Driver Performance Benchmark Report

Below are the results of testing PostgreSQL client driver implementations. Each client is constrained to run in a single process. Test environment: Linux 4.13.9-00004-gc7772acb4567 (gentoo 2.4.1, x86_64) on Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz.

Overall Results

The charts below show the geometric average of all benchmark results.

Individual Benchmarks

5-copyfrom.json x13

Test Setup

CREATE TABLE _test(a int, b int, c int, d text, e float, f int, g text);

Test Query

COPY _test(a, b, c, d, e, f, g) FROM STDIN
Args: [{'row': [10, 11, 10, 'TESTTESTTEST', 10.333, 12341234, '123412341234'], 'count': 10000}]

Detailed Benchmark Data

Geometric mean 5-copyfrom.json x13
golang-libpq
Queries/sec63.71 63.71
Rows/sec637127.09 637127.09
Min latency92.03ms 92.03ms
Mean latency203.126ms 203.126ms
Max latency325.43ms 325.43ms
Latency variation37.376ms (18.4%) 37.376ms (18.4%)
golang-pgx
Queries/sec180.82 180.82
Rows/sec1808186.6 1808186.6
Min latency20.26ms 20.26ms
Mean latency71.483ms 71.483ms
Max latency497.35ms 497.35ms
Latency variation32.148ms (44.97%) 32.148ms (44.97%)
python-aiopg
Queries/sec44.12 44.12
Rows/sec441156.08 441156.08
Min latency60.77ms 60.77ms
Mean latency290.79ms 290.79ms
Max latency551.52ms 551.52ms
Latency variation72.067ms (24.78%) 72.067ms (24.78%)
python-aiopg-tuples
Queries/sec44.54 44.54
Rows/sec445432.48 445432.48
Min latency58.29ms 58.29ms
Mean latency288.689ms 288.689ms
Max latency491.07ms 491.07ms
Latency variation69.58ms (24.1%) 69.58ms (24.1%)
python-asyncpg
Queries/sec266.09 266.09
Rows/sec2660923.11 2660923.11
Min latency15.95ms 15.95ms
Mean latency48.732ms 48.732ms
Max latency88.48ms 88.48ms
Latency variation9.914ms (20.34%) 9.914ms (20.34%)
nodejs-pg-js
Queries/sec8.25 8.25
Rows/sec82521.23 82521.23
Min latency387.05ms 387.05ms
Mean latency1492.868ms 1492.868ms
Max latency3064.6ms 3064.6ms
Latency variation228.321ms (15.29%) 228.321ms (15.29%)