to_write is a big-ol string that can get pretty hefty with lots of reallocations.
Instead: make it a std::vector<double> chopped_mi.
chopped_mi.reserve(roots.size() > 1 ? roots.size() : 0) or just roots.size() if the conditional is a bit much
and log the components piecemeal.
to_write
is a big-ol string that can get pretty hefty with lots of reallocations. Instead: make it astd::vector<double> chopped_mi
.chopped_mi.reserve(roots.size() > 1 ? roots.size() : 0)
or just roots.size() if the conditional is a bit much and log the components piecemeal.