Faster C++: Move Constructors and Perfect Forwarding


Just a few hours ago I delivered my Faster C++ talk at the 2012 Game Developers Conference. This was my thirteenth GDC presentation! The large room was packed, which is awesome, so the topic seemed relevant to the game development community. The great thing is that all major compilers support rvalue references, so it’s very actionable material. In fact, just by upgrading to C++11 you get a free performance boost. If you attended the talk, thanks for coming. You can find a link to the slides here: http://www.tantalon.com/pete.htm. Enjoy move-enabling your game code!

Advertisements
This entry was posted in C++, Game Programming. Bookmark the permalink.

4 Responses to Faster C++: Move Constructors and Perfect Forwarding

  1. Jeff says:

    I enjoyed your GDC presentation, thanks.

  2. brucedawson says:

    I’ve added move constructors to some of our classes and it helped reduce memory allocation churn from copying. Usually we try to avoid the copying through other means, but move constructors are convenient.

    Once nice thing about move constructors is that they are transparent to the code that uses the objects, so we can conditionally compile them for those compilers that currently support them. It just requires having a few lines of code in the class declaration and the client code automatically uses them when available.

    The bad news is that since we don’t yet have support for move constructors in all of our compilers we can’t count on the performance improvements, so we still have to use other methods to reduce object copying overhead.

  3. Hi there, I would like to subscribe for this website to get most up-to-date
    updates, so where can i do it please help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s