Comparing caching strategies
Dino
dino at no.spam.ar
Fri Feb 10 19:39:48 EST 2023
First off, a big shout out to Peter J. Holzer, who mentioned roaring
bitmaps a few days ago and led me to quite a discovery.
Now I am stuck with an internal dispute with another software architect
(well, with a software architect, I should say, as I probably shouldn't
define myself a software architect when confronted with people with more
experience than me in building more complex systems).
Anyway, now that I know what roaring bitmaps are (and what they can
do!), my point is that we should abandon other attempts to build a
caching layer for our project and just veer decidedly towards relying on
those magic bitmaps and screw anything else. Sure, there is some
overhead marshaling our entries into integers and back, but the sheer
speed and compactness of RBMs trump any other consideration (according
to me, not according to the other guy, obviously).
Long story short: I want to prototype a couple of caching strategies in
Python using bitmaps, and measure both performance and speed.
So, here are a few questions from an inexperienced programmer for you,
friends. Apologies if they are a bit "open ended".
- How would you structure the caching so that different caching
strategies are "pluggable"? change one line of code (or even a config
file) and a different caching strategy is used in the next run. Is this
the job for a design pattern such as factory or facade?
- what tool should I use to measure/log performance and memory
occupation of my script? Google is coming up with quite a few options,
but I value the opinion of people here a lot.
Thank you for any feedback you may be able to provide.
Dino
More information about the Python-list
mailing list