LLNL / axom

CS infrastructure components for HPC applications
BSD 3-Clause "New" or "Revised" License
159 stars 27 forks source link

Improve performance of `axom::Array::push_back` #1471

Open kennyweiss opened 1 week ago

kennyweiss commented 1 week ago

In https://github.com/LLNL/axom/pull/1469, we added some initial benchmarking of axom::Array w.r.t. std::vector (see also #287), and observed that axom::Array was slower for push_back and emplace_back operations on native types.

Initial profiling using hpctoolkit did not reveal any low-hanging fruit. Our assumption is that the performance might be due to function call overhead, e.g. for functions that are not inlined.

@publixsubfan noticed that axom::Array::emplace() calls the virtual function Array::updateNumElements(), and axom::Array has several other virtual functions.