When should one prefer object pool over dynamically allocated objects?
I need to create and destroy thousands of objects per second. Is it by itself enough to decide in favor of object pool?
Thanks.
Yes, this is enough to decide in favor of object pool.
Quoting Boost documentation
When should I use Pool?
Pools are generally used when there is a lot of allocation and deallocation of small objects. Another common usage is the situation above, where many objects may be dropped out of memory.
See Boost Pool library