Slauma Slauma

Niner since 2010


  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 6 of n


    Thanks for your extensive reply, a lot of helpful points in it!

    I have one remark and one question:

    1) I've moved my library to VS2010 to make a performance test: It runs 8% faster compared to VS2008 on the same machine. But this is only the total time including some file read/write and other operations. The benefit for the part which works extensively on the STL containers will probably have more than 8% performance increase (but not more than roughly 20% to 25% which is still fine for me considering that I didn't have any work to achieve this except recompiling).

    2) Why didn't you use the new allocator_chunklist in VS2010 instead of your hand-written block allocator? Isn't this allocators intention to provide a block allocation out of the box? Did you avoid it because the allocator is in the stdext namespace and not standard compliant? Does the allocator_chunklist have any drawbacks? (I'm asking because it's the allocator I am planning to make use of in my library.)


  • C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 6 of n

    Hi Stephan, thanks for these great lectures! They are very, very useful and unique to have an introduction into the new STL features available in VS2010.

    There is one special subject that I would love to hear more about in one of your future STL videos - and that is: Allocators.

    Accidentally I saw on the Dinkumware website that they offer an "Allocators library". Taking then a closer look to MSDN I found that this library is indeed also part of VS2010 ("allocators" header file). Is that new in VS2010? At least I can't remember having this in VS2008.

    I'm especially interested in this subject because I am maintaining a library (currently still in VS2008) which deals with very large datasets (detailled road networks for Europe) and does shortest path calculations on the network based on a preprocessed graph which allows for much faster path calculations.

    This mentioned preprocessing uses STL and I'm having constant trouble with memory management, especially memory fragmentation, because the algorithm used by this preprocessing happens to need a huge amount of inserts and removes of small objects from map and list containers. I've already done a lot of changes and optimizations of the algorithm itself but I am pretty sure that I could make a major step forward by replacing the STL default allocator by some other allocator which can help to reduce memory fragmentation.

    So I was happy to see now a thing like "allocator_chunklist" and the other allocators in the library which allow to customize memory management in STL.

    Well, perhaps this wish is too special for your introduction, but it would be great if you could spend a few minutes on this subject sooner or later!

    Anyway, if so or not, I'm prepared for a download of the next lecture and hope you still have a lot of stuff to talk about!

    Thanks again for your very motivating lectures!