Open yakra opened 2 years ago
tag | BT time |
commit | descr |
---|---|---|---|
522 | 6.8310 | e36c5261466c942a9cf8ac52d952ebfc4726a3c8 | |
hrm1a | 6.8232 | a021901 |
std::accumulate with overloaded +. Only check membership @ beginning. No more derefs yet. |
hrm0 | 6.8316 | 2 redundant conditionals combined into 1. No diffs. 0.3 ms slower? Just noise! :rofl: Less code + less branches = good! |
|
hrm1b | 6.8363 | hrm1a + hrm0 lol I want a mulligan on the time! | |
hrm1c | 6.8355 | ff2b65f |
map_sum template. Fewer lines of code than overloaded +surely lower compile time than numeric . :P |
Seems to make things slower, counterintuitively. Might get back to this later.
Rather than overload the +
operator & #include <numeric>
entirely (compilation time?) to use std:accumulate
, here's what I came up with:
template <class map>
double map_sum(const map& m)
{ double sum = 0;
for (auto& kv : m) sum += kv.second;
return sum;
}
Leaving this here for now while I delete the branch.
May come back to this once other options are in place, e.g. the chop3
branch's to_write
& format_clinched_mi
optimizations.
This function. This function right here. https://github.com/yakra/DataProcessing/blob/cc9da66106a7581974938040418b845dcedaf4b2/siteupdate/cplusplus/classes/TravelerList/TravelerList.cpp#L162-L167
double t_system_overall = system_region_miles(h);
, have the function catch the exception and keep on truckin', returning 0. Nope! 6.8310 -> 7.0672 s on BiggaTomato. Maybe this could be a good improvement for FreeBSD? :grinning: Try it anyway for giggles... Nope. 5% longer.std::accumulate
magically be faster for item 1 above? Because accumulators LOL.