-
Notifications
You must be signed in to change notification settings - Fork 237
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
Better mapper cache interface #363
Conversation
…che a better an interface for implementing externally` Signed-off-by: glightfoot <glightfoot@rsglab.com>
1abd942
to
0099df7
Compare
Signed-off-by: glightfoot <glightfoot@rsglab.com>
8027ca6
to
de9a51c
Compare
Signed-off-by: glightfoot <glightfoot@rsglab.com>
Signed-off-by: glightfoot <glightfoot@rsglab.com>
I just now realized the mapper cache issue was actually to wrap the mapper with a cache. I didn’t actually read that issue in detail, but I think having the mapper use a cache is important enough of a performance improvement to keep in there. Thoughts? |
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.
Aesthetically I would find the wrapping approach more pleasing, but this is definitely an improvement, and I am happy with it! I left a few comments but nothing major stands out.
@matthiasr I removed the noop cache entirely and hid the cache calls behind |
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! What is missing to take it out of Draft?
Signed-off-by: glightfoot <glightfoot@rsglab.com>
d0f5160
to
8b306c8
Compare
Signed-off-by: glightfoot <glightfoot@rsglab.com>
Ahh sorry about that! Got busy with a job change. Should be ready for review |
Thanks a lot! |
Kind of fixes #295 and kind of fixes #362 by removing the lru code from the mapper package.
First stab at moving this to a better interface. The noop cache is now default (was lru), and the rr and lru mapper caches have been moved to a different package. This makes it easier for users of the packages to implement their own caches as the interface is much simpler.
Instead of calling InitCache, there is a UseCache method on mapper to set a cache.
I still want to rework the metrics, but need to think about a better way to do so. I wanted to get some feedback before spending any more time on it.
@matthiasr
Signed-off-by: glightfoot glightfoot@rsglab.com