|
-
October 1st, 2008, 08:07 AM
#1
Do shared pointers incur performance penalties?
I've been considering using shared pointers (e.g., Boost Smart Pointers) but want to know in what situations they would incur performance penalties. I need to write some programs where execution speed is very important. Can someone enlighten me on this?
-
October 1st, 2008, 09:21 AM
#2
Re: Do shared pointers incur performance penalties?
 Originally Posted by msgboardjunkie
I've been considering using shared pointers (e.g., Boost Smart Pointers) but want to know in what situations they would incur performance penalties. I need to write some programs where execution speed is very important. Can someone enlighten me on this?
Yes they do. Here are Boost's own timings,
http://www.boost.org/doc/libs/1_36_0...smarttests.htm
In my experience in the general case the code safety and ease of use of a shared smart pointer vastly outweigths the overhead.
But there's a grayzone when you want some more speed and is willing to trade in some flexibility and ease of use for speed. Then I use an intrusive smart pointer.
Finally there's the extreme case when speed is all important or smart pointers cannot be used because of cyclic references. Then raw pointers rule.
Last edited by _uj; October 1st, 2008 at 09:43 AM.
-
October 1st, 2008, 11:17 AM
#3
Re: Do shared pointers incur performance penalties?
Wow! thank you so much. this is a great article!
-
October 1st, 2008, 07:38 PM
#4
Re: Do shared pointers incur performance penalties?
Probably not the best place for that question, anyways:
I'm working with qt from its very first release. Now, that NOKIA bought the whole Trolltech, it's getting too expensive. I heard a lot of good things about BOOST. Any recommendable source??
Thanks and best from the south.
ariell
programming is understanding
-
October 1st, 2008, 10:18 PM
#5
Re: Do shared pointers incur performance penalties?
Woh, Nokia had bought QT. This is a sad news to us.
-
October 2nd, 2008, 12:55 AM
#6
Re: Do shared pointers incur performance penalties?
 Originally Posted by ariell
Probably not the best place for that question, anyways:
I'm working with qt from its very first release. Now, that NOKIA bought the whole Trolltech, it's getting too expensive. I heard a lot of good things about BOOST. Any recommendable source??
Thanks and best from the south.
It's considered rude to hijack other people's threads.
Anyway Qt is a GUI and Boost doesn't offer a GUI. Check out wxWidgets. It's an open source portable GUI.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|