Reduce time-tracking overhead - #1988
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1988 +/- ##
===========================================
+ Coverage 75.92% 76.08% +0.15%
===========================================
Files 76 76
Lines 12995 13002 +7
===========================================
+ Hits 9867 9893 +26
+ Misses 3128 3109 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* Don't check `clock()` on every rhs evaluation, but only every 1000. * Avoid `clock()` completely, if there is no max time specified.
Co-authored-by: Fabian Fröhlich <fabian_froehlich@hms.harvard.edu>
| // Avoid expensive syscalls by checking only every N rhs evaluations | ||
| static int eval_counter = 0; | ||
| int const interval = 1000; | ||
| if (++eval_counter / interval) { |
There was a problem hiding this comment.
What about rather extending solver->timeExceeded() by adding the counter as private member of solver and checking against that in every call?
There was a problem hiding this comment.
Thought about it, but it wouldn't work with
Line 148 in eba2cad
There we want to check on every call. Would have to add some force_check=True argument or a separate method.
There was a problem hiding this comment.
Thought about it, but it wouldn't work with
Line 148 in eba2cad
There we want to check on every call. Would have to add some force_check=True argument or a separate method.
I think I would prefer that.
|
SonarCloud Quality Gate failed. |








clock()on every rhs evaluation, but only every 500.clock()completely, if there is no max time specified.