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

feat: add lru cache #395

Merged
merged 3 commits into from Jul 29, 2022
Merged

feat: add lru cache #395

merged 3 commits into from Jul 29, 2022

Conversation

andrewleap-optimizely
Copy link
Contributor

Summary

Add a generic LRU cache to support efficient caching of the ODP segments results.

  • Add Least Recently Used (LRU) cache
  • design to allow developer to pass in different caching implementation. Provide default.

Test plan

Added:

  • test_lru_cache.py

Ticket:

OASIS-8404

optimizely/odp/lru_cache.py Show resolved Hide resolved
optimizely/odp/lru_cache.py Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
tests/test_lru_cache.py Show resolved Hide resolved
@Mat001
Copy link
Contributor

Mat001 commented Jul 27, 2022

PS: I still need to approve...I'm curious about Jae's comments first, if any

Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

Looks good! A few changes suggested.

optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
optimizely/odp/lru_cache.py Show resolved Hide resolved
optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
tests/test_lru_cache.py Outdated Show resolved Hide resolved
tests/test_lru_cache.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

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

approve after jae's changes addressed

Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

All changes look good. One more change suggested.

optimizely/odp/lru_cache.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewleap-optimizely andrewleap-optimizely merged commit aee87a5 into master Jul 29, 2022
@andrewleap-optimizely andrewleap-optimizely deleted the aleap/add_lru_cache branch July 29, 2022 15:47
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.

None yet

3 participants