yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

Region::compute_stats: use temporaries? #258

Open yakra opened 11 months ago

yakra commented 11 months ago

Floating-point division is expensive. Some redundant calculations occur not just for a HighwaySegment itself, but every traveler on it.

const double act_length = s.length/act_concurrency_count;
const double a_p_length = s.length/a_p_concurrency_count;
const double sys_length = s.length/sys_concurrency_count;

and replace the expressions accordingly.

IIRC, benchmarking during the Region::compute_stats reunification (TravelMapping#584) suggested this didn't amount to much, but it may be worth another look.

But first?