You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at the moment, the average execution time is calculated by using self.totalOperations of the Benchmark instance.
If I'm not mistaken, this gives invalid results since the number of ops is incremented in multiple places; here and here - additionally, the user-side code can increment it by calling b.incrementOperations(1), as in your 'basic' example.
This seems a bit like a separation-of-concerns thing; as a clean solution why not use self.durations.items.len as denominator ?
The text was updated successfully, but these errors were encountered:
Thank you. You're correct, incrementing self.totalOperations in multiple places can lead to inconsistent or incorrect results when calculating the average execution time, especially when b.incrementOperations(1) is also called in the user-side code.
I've created a Pull Request to implement this change. Feel free to review and provide any feedback.
at the moment, the average execution time is calculated by using self.totalOperations of the Benchmark instance.
If I'm not mistaken, this gives invalid results since the number of ops is incremented in multiple places; here and here - additionally, the user-side code can increment it by calling
b.incrementOperations(1)
, as in your 'basic' example.This seems a bit like a separation-of-concerns thing; as a clean solution why not use
self.durations.items.len
as denominator ?The text was updated successfully, but these errors were encountered: