postgres-nio icon indicating copy to clipboard operation
postgres-nio copied to clipboard

New connection manager performance issues

Open adam-fowler opened this issue 8 months ago • 1 comments

Describe the issue

The new connection manager that PostgresClient uses has performance issues with lock contention

Vapor version

Not using

Operating system and version

MacOS 15.3.2 (24D81)

Swift version

Apple Swift version 6.0.3

Steps to reproduce

If PostgresClient is setup with a sizeable number of connections then it will lock the state of the connection manager for long periods as ConnectionGroup searches through the list of connections repeatedly using code like this

let index = self.connections.firstIndex(where: { $0.id == connection.id })
```

### Outcome

Its slow!!

### Additional notes

_No response_

adam-fowler avatar Mar 24 '25 15:03 adam-fowler

@adam-fowler Can you maybe checkout the branch in #551 and provide some feedback?

Thank you!

fabianfett avatar May 15 '25 15:05 fabianfett