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

  • SEARCH
  • Home
  • 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 6200441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:22:09+00:00 2026-05-24T04:22:09+00:00

How good is boost::intrusive library for high performance computing? I want to use a

  • 0

How good is boost::intrusive library for high performance computing?
I want to use a container for a non-copyable non-assignable class. I was planning to use
normal STL with shared_ptr. I found out that boost::intrusive can also be used for the same purpose. So my question is, are they really that efficient?

if given an option between a STL container with shared_ptr types and a boost::intrusive which one would you prefer?

  • 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-24T04:22:10+00:00Added an answer on May 24, 2026 at 4:22 am

    Generally, intrusive collections are the most efficient in terms of memory usage. If your goal is to squeeze every last cpu cycle that is the only way to go.

    Consider a list of boost shared pointers. When creating a new object what happens is:

    • the object allocated from the heap and initialized
    • constructor of boost shared pointer from a raw pointer allocates another object on the heap to store the object’a reference counter (that is why boost intrusive pointer is better since the reference counter is stored in the object avoiding this allocation)
    • list::insert allocates a list node and copies the shared pointer

    In the above, there are three memory allocations involved to create and insert a new object into a collection.

    Now consider using an intrusive list. For the same task what happens is:

    • a new object gets allocated and initialized
    • list::insert just assigns to the object’s list node pointers, since the node is embedded in the object and has been already allocated

    Here, only one memory allocation happens. Since the cpu addresses less memory when using intrusive collections, cpu caches get utilized better, resulting in fewer cache misses along with reduced memory footprint (known as locality of reference principle).

    The drawback of intrusive collections is that it has to be known in advance in what type and how many collections an object can be an element of at one time. In my personal experience this extra upfront thinking leads to cleaner and simpler designs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering how good is the Boost Spirit Library. I have begun to read
boost:: asio provides an example of how to use the library to implement asynchronous
I've been using the Boost serialization library, which is actually pretty nice, and lets
I wrote some code to generate a boost::mpl::vector to use as a lookup table
I'd like to use the boost::transform_iterator together with boost::bind to return the result of
I've got some legacy code here that makes use of boost::filesystem in version 1.34.1.
Good morning, I am about to start writing an Excel add-in for Excel 2002.
Good morgning, I would like to be able to analyze text where I am
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good morning. I have an XML file which contains lists of warning and errors

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.