At the moment i use the STL vector container template to put back and get the connections.
1) on get, a connection is returned and “erase()”d from pool vector.
2) on release, the connection is handed back to the pool via “push_back()”.
This might be very heavy if the pool is frequently used. So my question is, is there any way to improve the performance here by switching to an other data structure?
vectoris fine.deque.list.setmight be an alternative.In any case, you should profile the performance; use a typedef for your main container so you can quickly switch and test the different options.
There may be other requirements which you aren’t telling us but which are important for the choice of container: