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

LRU: fix eviction order #1092

Merged
merged 5 commits into from
Jun 13, 2023
Merged

Conversation

bchamagne
Copy link
Member

@bchamagne bchamagne commented Jun 13, 2023

Description

An issue @Neylix found while benchmarking the LRU.
The order was reversed on every eviction.

(+ lint to remove useless fn
(+ optimisation by reversing keys outside of the eviction loop

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit tested

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@bchamagne bchamagne added the bug Something isn't working label Jun 13, 2023
@bchamagne bchamagne added this to the 1.1.2 milestone Jun 13, 2023
@bchamagne bchamagne requested a review from Neylix June 13, 2023 09:26
@Neylix Neylix merged commit 4b7944f into archethic-foundation:1.1.2 Jun 13, 2023
1 check passed
Neylix pushed a commit to Neylix/archethic-node that referenced this pull request Jun 14, 2023
* Fix the LRU eviction order

* LINT: remove useless fn

* Use a split instead of 2 reverse

* Revert "Use a split instead of 2 reverse"

This reverts commit 277efe3.

* reverse the keys outside of the evict loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants