Skip to content
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

Native Promise slow((( #1512

Closed
masksnytko opened this issue Nov 20, 2017 · 6 comments
Closed

Native Promise slow((( #1512

masksnytko opened this issue Nov 20, 2017 · 6 comments

Comments

@masksnytko
Copy link

result = new Promise((resolve, reject) => {

I recommend using bluebirdjs
const Promise = require("bluebird");

@charmander
Copy link
Collaborator

Callbacks are supported, so you can use Bluebird’s promisify to get a Bluebird promise. (The Pool constructor also allows a Promise type to be passed in, though it doesn’t apply to clients. Maybe it should.)

@gajus
Copy link
Contributor

gajus commented May 19, 2018

The Pool constructor also allows a Promise type to be passed in, though it doesn’t apply to clients. Maybe it should.

This appears to be no longer the case.

Is there a way to pass a custom Promise implementation to node-postgres?

The stack trace for async/ await indeed sucks.

@charmander
Copy link
Collaborator

This appears to be no longer the case.

@gajus I’m not sure what you mean; nothing’s changed here.

@gajus
Copy link
Contributor

gajus commented May 20, 2018

@gajus I’m not sure what you mean; nothing’s changed here.

I don't see an option to pass Promise constructor to Pool constructor.

https://node-postgres.com/api/client#client-api

@charmander
Copy link
Collaborator

@gajus It’s missing from the new documentation, but still exists. (#1518 will also add it to Client after #1503 is resolved.)

@fanatid
Copy link

fanatid commented Nov 5, 2018

@masksnytko do you have benchmarks which shows how much native slower compare to bluebird in current package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants