-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
fix(Layout): layout cache does not grow without bounds #487
Conversation
Codecov Report
@@ Coverage Diff @@
## main #487 +/- ##
==========================================
+ Coverage 89.89% 89.93% +0.04%
==========================================
Files 41 41
Lines 11286 11334 +48
==========================================
+ Hits 10145 10193 +48
Misses 1141 1141
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - happy to merge this with or without the suggestions.
Edit: I just noticed the lint check - can you please run cargo make format
and bump this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is great.
Docs look good - thanks for adding these.
A couple of minor changes to make the docs render the DEFAULT_CACHE_SIZE. You might also need to rewrap the doc text if these changes are made. Check the VSCode Rewrap extension or configure your IDE / editor to wrap at 100 chars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for your contribution.
* change cache size from a field into a const * support for custom cache size initialization
70eaff6
to
064cf8e
Compare
I rebased on main, squashed and updated the commit message so it would look nice in the Changelog and merged this.
Thanks for submitting this PR. We appreciate your contribution. |
This pull request avoids the growth of Layout cache without any bounds.
The Layout cache is now using an LruCache (doc).
The current default cache size is set to 16. It seems reasonable for me to keep this value low.
A user can set the cache size during the Layout instantiation.
fix #402