News for hackers. Stuff that matters.
Re:Google paper comparing performance of C++, Java, Scala, a... by saucetenuto on Friday June 03, 2011 @11:56AM (#2616829)
Here's one that bites every c++ newbie at least once (please forgive minor syntactic mistakes, it's been a while):

    std::vector<LargeStruct> things = GetABunchOfThings(); // Why does this take so long?

    // Oh well, time to sort
    std::sort(things.begin(), things.end(), LargeStructComparator());
...and then your program takes forever and your profiler tells you that 99.9% of your time is spent in LargeStruct's copy constructor. And then you refactor to use pointers and teach the comparator to dereference them, whatever, it's fine, but the naive Python version will just work.

Of course, after c++0x becomes widespread this problem will go away. Yay move constructors.

Re:Google paper comparing performance of C++, Java, Scala, a... by jongraehl on Saturday June 04, 2011 @05:44PM (#2620542)
Basically correct, except std::sort uses assignment, not copy construction.

It's also likely that the optimizer will have GetABunchOfThings construct its result once in the caller's "things". Lambdas are C++0x, so maybe move constructors (another C++0x feature) will be employed instead.