-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Switch internals to use faster connection #2210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
something weird going on....the cursor tests in travis are really slow. The whole pg-cursor test suite finishes locally for me in 524 milliseconds, while in travis each individual test is taking 100-200 milliseconds...hmm... |
This comment has been minimized.
This comment has been minimized.
Just to say that I've enabled |
This comment has been minimized.
This comment has been minimized.
447924a
to
08afb12
Compare
ah yes gotta |
Hey @sehrope - do you think you could check what's up w/ the SCRAM test failure? I am still trying to get it to work locally...but something's up because it's failing in travis. edit: got it figured out. super glad you just added those tests & I caught this! 👯 |
I think I figured it out actually....concerned tests have never caught this issue (until now) but it looks like the scram parsing was off by 1 byte, but usually "just worked" due to the way buffers were coming in. https://github.com/brianc/node-postgres/pull/2210/files#diff-1449b1bce007eeb37fb3f3077d2dd1cbL466 That should be |
Wowza. So was this a bug in something that changed or was the existing one impacted as well? Curious how the existing SCRAM tests are passing. Or is it a kind of double bug where the parser is broken but the rest of the scram code was compensating by slicing the extra piece? |
🚀 |
From what I can tell it's always been there - reading |
thanks for the 👀 @charmander ❤️ |
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 which is making it harder to juggle other changes. The changes here are backwards compatible. The only tests I modified is 1 very old unit test for testing the parsing internals, which I have already ported to the new pg-protocol package and extended over there. So...should be good to go!
Anecdotally...I'm working on a feature at work where we are streaming tens of thousands of pretty large rows. I was running
PG_FAST_CONNECTION=true
& the query went from 12.5 seconds on average to 7 seconds on average.