Skip to content

Commit 520bd35

Browse files
committed
Switch internals to use faster connection
This switches the internals to use faster protocol parsing & serializing. This results in a significant (30% - 50%) speed up in some common query patterns. There is quite a bit more performance work I need to do, but this takes care of some initial stuff & removes a big fork in the code.
1 parent 1c441d2 commit 520bd35

File tree

5 files changed

+51
-939
lines changed

5 files changed

+51
-939
lines changed

.travis.yml

+8-10
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@ before_script: |
77
88
env:
99
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
10-
# test w/ new faster parsing code
11-
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PG_FAST_CONNECTION=true
1210

1311
node_js:
1412
- lts/dubnium
1513
- lts/erbium
1614
# node 13.7 seems to have changed behavior of async iterators exiting early on streams
1715
# if 13.8 still has this problem when it comes down I'll talk to the node team about the change
18-
# in the mean time...peg to 13.6
16+
# in the mean time...peg to 13.6
1917
- 13.6
2018
- 14
2119

2220
addons:
23-
postgresql: "10"
21+
postgresql: '10'
2422

2523
matrix:
2624
include:
@@ -42,25 +40,25 @@ matrix:
4240
4341
- node_js: lts/carbon
4442
addons:
45-
postgresql: "9.5"
43+
postgresql: '9.5'
4644
dist: precise
4745

4846
# different PostgreSQL versions on Node LTS
4947
- node_js: lts/erbium
5048
addons:
51-
postgresql: "9.3"
49+
postgresql: '9.3'
5250
- node_js: lts/erbium
5351
addons:
54-
postgresql: "9.4"
52+
postgresql: '9.4'
5553
- node_js: lts/erbium
5654
addons:
57-
postgresql: "9.5"
55+
postgresql: '9.5'
5856
- node_js: lts/erbium
5957
addons:
60-
postgresql: "9.6"
58+
postgresql: '9.6'
6159

6260
# PostgreSQL 9.2 only works on precise
6361
- node_js: lts/carbon
6462
addons:
65-
postgresql: "9.2"
63+
postgresql: '9.2'
6664
dist: precise

packages/pg/lib/client.js

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ var ConnectionParameters = require('./connection-parameters')
1818
var Query = require('./query')
1919
var defaults = require('./defaults')
2020
var Connection = require('./connection')
21-
if (process.env.PG_FAST_CONNECTION) {
22-
Connection = require('./connection-fast')
23-
}
2421

2522
var Client = function (config) {
2623
EventEmitter.call(this)

packages/pg/lib/connection-fast.js

-214
This file was deleted.

0 commit comments

Comments
 (0)