Skip to content

Improve performance of early stop check in ES#168

Open
dpaetzel wants to merge 1 commit intoheidmic:masterfrom
dpaetzel:improve-es-early-stop
Open

Improve performance of early stop check in ES#168
dpaetzel wants to merge 1 commit intoheidmic:masterfrom
dpaetzel:improve-es-early-stop

Conversation

@dpaetzel
Copy link
Copy Markdown
Collaborator

The early stopping check was previously implemented using a deque which ultimately results in self.delay many (typically hundreds) comparisons in each iteration. Now it's based on a counter since the last improvement which reduces the number of comparisons/updates to less than a handful.

@dpaetzel dpaetzel requested a review from Saethox December 11, 2024 15:18
@dpaetzel dpaetzel force-pushed the improve-es-early-stop branch from 183be9b to 4c2c666 Compare December 11, 2024 16:07
@dpaetzel dpaetzel force-pushed the improve-es-early-stop branch from 4c2c666 to b69683f Compare December 11, 2024 16:14
Copy link
Copy Markdown
Collaborator

@Saethox Saethox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RomanSraj RomanSraj self-requested a review December 12, 2024 08:21
Copy link
Copy Markdown
Collaborator

@RomanSraj RomanSraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@heidmic
Copy link
Copy Markdown
Owner

heidmic commented Dec 12, 2024

David sent me preliminary results that the new version might actually be slower. @RomanSraj please test this on our typical problem sizes

@dpaetzel
Copy link
Copy Markdown
Collaborator Author

I think the results of the very few tests (10 repetitions on a single problem instance) I ran are well within the range of “not faster or slower in a neither statistically nor practically significant way”. This change should thus probably be seen as nothing more but a small refactoring.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants