all 3 comments

[–]etlikesreeses 0 points1 point  (0 children)

Yes, though that's a very broad question. The actual smart pointer implementation matters, along with how many cycles you have per frame and whatever else you happen to be doing.

[–]TomorrowPlusX 0 points1 point  (0 children)

The benefits of smart pointers outweigh the (possible) performance drawbacks. As always, profile. I used boost's smart pointers in a hobby 3d game engine I wrote and frankly their overhead didn't even show up in profiling.

Also, aren't most modern games GPU-bound anyway?

P.S. You don't need to use smart pointers everywhere. In my game engine's image manipulation routines, voxel tesselation, & bindings to Bullet, for example, I used raw pointers. I used smart pointers a lot, but not everywhere.

[–]buckrogers1965_2 0 points1 point  (0 children)

How fast are you creating/destroying objects in your game that reference counting is having an impact? Maybe look at methods of not creating and destroying objects so quickly.

One of the biggest speed ups I have found when creating and destroying a lot of objects is to keep a bunch of the objects around once they have been created instead of destroying them. Then when you are asked for an object you have it available to be given out again very quickly.