You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #232 reduces the cost of copy-constructor.
I have some idea to solve the problem without drastic design change,
use boost::container::flat_map. this makes memory requirement smaller than that of std::(tr1::)unordered_map.
use boost::container::small_vector<std::pair<string, attribute_type>, N>. This removes heap allocation when the number of attributes is less than N. If you need more attributes, it will allocate enough memory.
use boost::array<std::pair<string, attribute_type>, N> and boost::optional<(unordered_)map<string, attribute_type>>. This has mostly the same effect as 2.
If ecell4 can use the latest version of Boost (1.66.0), boost::container::small_vector can be used as a backend of boost::container::flat_map. I think it is the best way because it conserves the interface and remove small heap allocation simultaneously.
This would be due to attributes.
https://github.com/ecell/ecell4/blob/master/ecell4/core/Species.hpp#L52-L61
Species should be lightweight and handy.
The text was updated successfully, but these errors were encountered: