Skip to content

Commit 68a1b4b

Browse files
committed
Improve docs
1 parent 0aaffac commit 68a1b4b

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

+18-7
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ This is a set of benchmarks focusing on the performance of Postgres client libra
66
77
Currently benchmarked libraries are
88

9-
- [postgres](https://github.com/porsager/postgres)
9+
- [Postgres.js](https://github.com/porsager/postgres)
1010
- [pg-promise](https://github.com/vitaly-t/pg-promise)
1111
- [pg](https://github.com/brianc/node-postgres)
1212
- [pg-native](https://github.com/brianc/node-pg-native)
13+
- [slonik](https://github.com/gajus/slonik)
14+
1315

1416
## Results
1517

@@ -18,12 +20,12 @@ The time is the average of 5 rounds, running the queries 10,000 times after some
1820

1921
client | select | select_arg | select_args | select_where
2022
:--------- | -------------: | -------------: | -------------: | -------------:
21-
postgres | 0.100s (4.8x) | 0.105s (7.4x) | 0.231s (4.3x) | 0.233s (5.1x)
22-
pg-promise | 0.360s (1.3x) | 0.427s (1.8x) | 0.662s (1.5x) | 0.801s (1.5x)
23-
pg-promise-native | 0.371s (1.3x) | 0.435s (1.8x) | 0.673s (1.5x) | 0.807s (1.5x)
24-
pg | 0.322s (1.5x) | 0.611s (1.3x) | 0.815s (1.2x) | 1.057s (1.1x)
25-
pg-native | 0.479s (1.0x) | 0.551s (1.4x) | 0.885s (1.1x) | 1.183s (1.0x)
26-
slonik | 0.453s (1.1x) | 0.773s (1.0x) | 0.992s (1.0x) | 1.108s (1.1x)
23+
[Postgres.js](https://github.com/porsager/postgres) | 0.100s (4.8x) | 0.105s (7.4x) | 0.231s (4.3x) | 0.233s (5.1x)
24+
[pg-promise](https://github.com/vitaly-t/pg-promise) | 0.360s (1.3x) | 0.427s (1.8x) | 0.662s (1.5x) | 0.801s (1.5x)
25+
[pg-promise-native](https://github.com/vitaly-t/pg-promise) | 0.371s (1.3x) | 0.435s (1.8x) | 0.673s (1.5x) | 0.807s (1.5x)
26+
[pg](https://github.com/brianc/node-postgres) | 0.322s (1.5x) | 0.611s (1.3x) | 0.815s (1.2x) | 1.057s (1.1x)
27+
[pg-native](https://github.com/brianc/node-pg-native) | 0.479s (1.0x) | 0.551s (1.4x) | 0.885s (1.1x) | 1.183s (1.0x)
28+
[slonik](https://github.com/gajus/slonik) | 0.453s (1.1x) | 0.773s (1.0x) | 0.992s (1.0x) | 1.108s (1.1x)
2729

2830
![results chart](results.png)
2931
> lower is better
@@ -72,3 +74,12 @@ select * from pg_catalog.pg_type where typname = $1
7274
--$1 = 'bool'
7375
```
7476

77+
78+
#### Running the benchmark
79+
80+
Ensure you have a PostgreSQL server running. You can add connection details using environment vars PGDATABASE, PGUSER etc.
81+
82+
```bash
83+
npm install
84+
npm start
85+
```

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"start": "node index.js"
88
},
99
"author": "",
1010
"license": "ISC",

0 commit comments

Comments
 (0)