brianc / node-pg-pool

A connection pool for node-postgres
MIT License
180 stars 64 forks source link

Use double-ended queue to improve performance #112

Closed Chocobozzz closed 5 years ago

Chocobozzz commented 5 years ago

Because shift() could be expensive when the pending queue is big

sehrope commented 5 years ago

-1. I don't think it's worth the added dependency and complexity.

In normal circumstances the pending queue is not going to be large and if the pool/database cannot keep up with inbound requests then it will grow indefinitely anyway. Speeding up the queue operations won't stop that as the core slow down would be from the query execution itself.

Chocobozzz commented 5 years ago

Good point :+1:

charmander commented 5 years ago

I think it’s worth it, but that removeFromDenque doesn’t look like it would work.

Chocobozzz commented 5 years ago

I can try to fix this if maintainers of the repository are interested in this PR :)