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

Transform the LRU cache to use ETS with pointer to head/tail #1097

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

samuelmanzanera
Copy link
Member

This remove the need to have a list of all values
and have to implement costly move key to front or eviction.

The implementation will leverage mainly key value & atomic counter operations.

Fixes #1089

Type of change

Please delete options that are not relevant.

  • Enhancements

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

@samuelmanzanera samuelmanzanera force-pushed the improve_lru_cache branch 3 times, most recently from cc18dd7 to b25f628 Compare June 14, 2023 16:43
@Neylix
Copy link
Member

Neylix commented Jun 27, 2023

We have to take care about the number of LRU we will start.
As the now a LRU starts ets table, we cannot start as many LRU as we want since the number of ets table is limited

@samuelmanzanera
Copy link
Member Author

We have to take care about the number of LRU we will start.
As the now a LRU starts ets table, we cannot start as many LRU as we want since the number of ets table is limited

IMG_20230627_125402.jpg

According to the doc this is not anymore the case. But even with 1400 tables this would give a lot LRUs to create.

This remove the need to have a list of all values
and have to implement costly move key to front or eviction.

The implemention will leverage mainly key value & atomic counter operations.
@bchamagne bchamagne merged commit b8903be into develop Sep 1, 2023
@bchamagne bchamagne deleted the improve_lru_cache branch September 1, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LRU: remove the usage of List.delete
3 participants