Skip to content

Commit d94f42c

Browse files
committed
docs: update bench setup
1 parent 2e2a0a5 commit d94f42c

7 files changed

Lines changed: 125 additions & 44 deletions

File tree

packages/benchmark/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ Binaries:
3030

3131
## Run benchmark
3232

33+
```bash
34+
docker run --name slonik-test --rm -it -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres -N 1000
35+
```
36+
3337
```bash
3438
npm install
3539
npm run benchmark
36-
3740
```
3841

3942
## Disclaimer

packages/benchmark/clients/pg-promise.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const pg = require('pg-promise');
22

33
const connect = pg()({
44
user: 'postgres',
5+
password: 'postgres',
56
}).connect;
67

78
module.exports = {

packages/benchmark/clients/pg.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const pg = require('pg');
22

33
const pool = new pg.Pool({
44
user: 'postgres',
5+
password: 'postgres',
56
});
67

78
const connect = () => {

packages/benchmark/clients/postgres.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const postgres = require('postgres');
22

3-
const sql = postgres('postgres://postgres@127.0.0.1:5432', {
3+
const sql = postgres('postgres://postgres:postgres@127.0.0.1:5432', {
44
// Unlike "pg", "pg-promise" and "slonik", "postgres" does provide a method to explicitly create a connection.
55
// https://github.com/porsager/postgres/tree/v3.0.0#the-connection-pool
66
// `max: 1` mimics this behavior as close as possible.

packages/benchmark/clients/slonik.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let poolPromise;
88

99
const connect = async () => {
1010
if (!poolPromise) {
11-
poolPromise = createPool('postgres://postgres@127.0.0.1:5432', {
11+
poolPromise = createPool('postgres://postgres:postgres@127.0.0.1:5432', {
1212
captureStackTrace: false,
1313
});
1414
}

packages/benchmark/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"private": true,
44
"dependencies": {
55
"benny": "^3.7.1",
6-
"pg": "^8.13.1",
7-
"pg-promise": "^11.10.2",
6+
"pg": "^8.15.6",
7+
"pg-promise": "^11.13.0",
88
"postgres": "^3.4.5",
99
"slonik": "^46.6.0"
1010
},

0 commit comments

Comments
 (0)