Optimalization in C++ library.