Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6238449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:12:57+00:00 2026-05-24T11:12:57+00:00

At the moment i use the STL vector container template to put back and

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:12:58+00:00Added an answer on May 24, 2026 at 11:12 am
    • If you only append at the back and erase from the back, vector is fine.
    • If you append and erase from both front and back, but never from the middle, use deque.
    • If you frequently must insert into and erase from the middle, use list.
    • Depending on your lookup and traversal requirements, set might 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:

    • vector and deque are random-access containers; list and set are node-based. This affects iterator invalidation.
    • vector, deque and list are sequence containers, while set is associative; this affects lookup by value.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use sendmail from Macs in an office. At the moment, I
At the moment I use DATEPART(yy, MY_DATE) = DATEPART(yy, GETDATE()) to get Year-To-Date details
I need subtract the result of contentCategories from allCategories at the moment I use
At the moment we use HSQLDB as an embedded database, but we search for
At the moment I use PHP for almost everything I develop for the Web
So right now I'm bashing my head - at the moment we use an
This question is for C# 2.0 Winform. For the moment I use checkboxes to
I have two nested loop in XSL like this, at this moment I use
I use a stream reader to import some data and at the moment I
I need to decide which configuration framework to use. At the moment I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.