Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Region::compute_stats: use temporaries? #258

Open
2 tasks
yakra opened this issue Jul 31, 2023 · 0 comments
Open
2 tasks

Region::compute_stats: use temporaries? #258

yakra opened this issue Jul 31, 2023 · 0 comments

Comments

@yakra
Copy link
Owner

yakra commented Jul 31, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant