Personal note: Following the C++ and Beyond seminar in October, I decided to replace the session “A Fresh Look at Containers and Iterators”. This is because the topic, albeit generous, has limited immediate applicability. Although the C++ community has considerable interest in packing iterators together in ranges and using range-oriented algorithms (per abstractions present in Boost and Adobe), mainstream use of STL remains through iterators. The new material concerns a much more immediate concern of C++ programmers.
Abstract:
STL’s performance has been satisfactory for a large range of applications. However, when using STL in large scale programs that have large tight performance programs, special care needs to be taken that doesn’t apply to smaller data sets. Amortized constant time is not terribly useful if multiplied by a constant that makes your application run forever. Doubling the size of a vector has unexpected effects. STL’s node allocation policy, while useful at small scale, may badly hurt performance. The allocator interface is unable to perform in-place reallocation. Even using realloc for moveable types is suboptimal. Finally, all stock allocators are very coy about releasing back memory to the operating system, which creates odd problems in long-running programs. This talk focuses on concrete tips for using STL (and C++ collections in general) scalably.
November 28, 2010 at 9:50 pm
Please note: the final post-Encore C++ and Beyond PDF will include materials from both October and December talks and will be made available to everybody at both C++ and Beyond events.
November 30, 2010 at 7:20 am
Andrei,
Thanks for making this available to attendees of the first session. This will be something I can put to good use.
November 29, 2010 at 1:10 pm
I won’t be able to make the encore, bad timing with the holidays and such. I hope you do it again sometime next year.
December 15, 2010 at 8:53 am
This sounds like a great topic. The issues you mention prevent us from using most STL containers for anything more than high level management functions - core algorithms and large data sets are generally severely impacted by STL containers.
One other issue we frequently run into is the problem of differing vendor implementations of STL containers and algorithms leading to widely inconsistent results across platforms and/or release versions.