Skip to content

Commit

Permalink
Switch internals to use faster connection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brianc committed May 12, 2020
1 parent 1c441d2 commit 520bd35
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 939 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ before_script: |
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
# test w/ new faster parsing code
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PG_FAST_CONNECTION=true

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

addons:
postgresql: "10"
postgresql: '10'

matrix:
include:
Expand All @@ -42,25 +40,25 @@ matrix:
- node_js: lts/carbon
addons:
postgresql: "9.5"
postgresql: '9.5'
dist: precise

# different PostgreSQL versions on Node LTS
- node_js: lts/erbium
addons:
postgresql: "9.3"
postgresql: '9.3'
- node_js: lts/erbium
addons:
postgresql: "9.4"
postgresql: '9.4'
- node_js: lts/erbium
addons:
postgresql: "9.5"
postgresql: '9.5'
- node_js: lts/erbium
addons:
postgresql: "9.6"
postgresql: '9.6'

# PostgreSQL 9.2 only works on precise
- node_js: lts/carbon
addons:
postgresql: "9.2"
postgresql: '9.2'
dist: precise
3 changes: 0 additions & 3 deletions packages/pg/lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ var ConnectionParameters = require('./connection-parameters')
var Query = require('./query')
var defaults = require('./defaults')
var Connection = require('./connection')
if (process.env.PG_FAST_CONNECTION) {
Connection = require('./connection-fast')
}

var Client = function (config) {
EventEmitter.call(this)
Expand Down
214 changes: 0 additions & 214 deletions packages/pg/lib/connection-fast.js

This file was deleted.

Loading

0 comments on commit 520bd35

Please sign in to comment.