Skip to content

Max memory limit#39

Merged
awolverp merged 7 commits intoawolverp:mainfrom
stalkerg:memory-limit
Dec 23, 2025
Merged

Max memory limit#39
awolverp merged 7 commits intoawolverp:mainfrom
stalkerg:memory-limit

Conversation

@stalkerg
Copy link
Copy Markdown
Contributor

@stalkerg stalkerg commented Dec 22, 2025

I did it to demonstrate how can be solved #38.
I tried to introduce one more optional parameter for the mem limit. All tests passed, and benchmarks show performance is almost the same.
But I may have missed something. Please look.

@stalkerg stalkerg changed the title Memory limit Max memory limit Dec 22, 2025
@stalkerg
Copy link
Copy Markdown
Contributor Author

hmmm, it seems like I accidentally fixed one bug, we have the next named tuple:

CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "length", "memory"])

But originally we returned capacity insteadof memory:

hits, misses, cache.maxsize, len(cache), cache.capacity()

Now I do:

hits, misses, cache.maxsize, len(cache), cache.memory()

@awolverp
Copy link
Copy Markdown
Owner

Thanks a lot! I'll merge and release in a few hours.

@awolverp awolverp merged commit fea3b18 into awolverp:main Dec 23, 2025
awolverp added a commit that referenced this pull request Dec 23, 2025
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.

2 participants