Adap.TV has chosen C++ to develop their software. However, they've decided not to use the standard containers1 and boost for performance reasons, as they've blogged about it in the following article:
It says (emphasis mine),
There are several rules that we are obeying in order to keep the performance high;
Avoid malloc(), calloc() or new
No free() or delete (and no need for tcmalloc)
No STL, boost etc.
Avoid locking as much as possible
# threads = # CPU cores (hyperthread is a trade-off between latency and throughput)
As we know, the standard containers use allocators which uses
delete internally which are expensive operations. So to avoid them, AdapTv has avoided using standard containers altogether. Instead of using
delete (repeatedly), they reuse memory (which implies they use a memory pool).
I'm wondering what's stopping them from using custom allocators for the standard containers! The custom allocator could use a memory pool internally which means memory reuse. So I don't see how standard containers would hurt performance.
Or am I missing something? Can't we avoid using
delete with standard containers? Is there any other reason why would anyone avoid using standard containers? Or is it simply a lack of knowledge on their part which led to this decision?
And how about boost?
1) I suppose by STL they meant C++ standard containers, not SGI's STL.