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

Replace Boost Timer with std::chrono #3461

Open
garth-wells opened this issue Oct 9, 2024 · 3 comments · May be fixed by #3484
Open

Replace Boost Timer with std::chrono #3461

garth-wells opened this issue Oct 9, 2024 · 3 comments · May be fixed by #3484
Labels
task A task to perform
Milestone

Comments

@garth-wells
Copy link
Member

We've observed accuracy issue with Boost Timer on some systems, plus removing it in favour of std::chrono (https://en.cppreference.com/w/cpp/header/chrono) is one less dependency.

@garth-wells garth-wells added the task A task to perform label Oct 9, 2024
@garth-wells garth-wells added this to the 0.10.0 milestone Oct 9, 2024
@IgorBaratta
Copy link
Member

I think there's also the issue that the timer is stored in seconds.
Maybe this conversion should be left to the end when we report timings.

const double wall = static_cast<double>(elapsed.wall) * 1e-9;

TimeLogManager::logger().register_timing(_task.value(), wall, user, system);

@jpdean
Copy link
Member

jpdean commented Oct 9, 2024

I checked the boost timer directly (elapsed.wall), and it doesn't seem to be the conversion that's causing the problem. The accuracy of the timer itself seems much worse than std::chrono, but maybe I'm missing something...

@IgorBaratta
Copy link
Member

I checked the boost timer directly (elapsed.wall), and it doesn't seem to be the conversion that's causing the problem. The accuracy of the timer itself seems much worse than std::chrono, but maybe I'm missing something...

I mean it more in general. Rounding to seconds with floating-point numbers can lead to accumulated rounding errors when many time values are summed over time. Since we more often measure times in the order micro seconds than days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task A task to perform
Projects
None yet
3 participants