Short version: IT++ should support the use of custom allocators (eg. boost::pool) in its classes.
Long version: I have written a software using IT++ which will frequently allocate matrices and vectors of varying sizes. Performance and memory profiling has shown that I may be running into heap fragmentation issues (main clues: 1) Valgrind reports 7GB total allocated while my program never shows up with more than 500MB of memory usage 2) Performance drops extremely at the point where the program starts using IT++-based code and keeps going down for some time).
I believe that I could address this issue using a custom allocator (eg. boost::pool or a completely custom version using several several fixed-size heaps). However, IT++ does not cleanly allow the use of a custom allocator.
As far as I could see from the code of itpp, all allocation and deallocation of memory in vectors and matrices is handled through factory.h. For standard data types this is hardcoded to use new/delete. Only for custom data types it is possible to supply a custom factory that handles allocation differently.
I believe this issue can be solved with the following steps:
1) Convert all create_element<>/destroy_elements<> implementations to appropriate calls in the default factory. This will allow users to submit custom Factories with custom allocators for standard data types. In itself this will not fix all issues, since in internal operations, itpp::Mat and itpp::Vec still fall back on the default factory, eg. in operator*= or in transpose() when temporary matrices are created.
2) Ensure that objects created within IT++ inherit the Factory of the creator or (if no parent object is available) the user can specify his own Factory to be used during the computation.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Side note: Managing all allocation and deallocation through the Factory class will mean an additional overhead of one virtual call per matrix/vector resize operation. I would expect this additional cost to be negligible compared to the effort of actual computations performed using IT++.