@lru_cache vs redis-simple-cache in Python

  Рет қаралды 8,105

Jack of Some

Jack of Some

Күн бұрын

Пікірлер: 25
@AnyFactor
@AnyFactor 3 жыл бұрын
It's a thankless job uploading content in the intermediate programming niche. Not many subs, not many views. But those who are watching appreciate your effort.
@JackofSome
@JackofSome 3 жыл бұрын
KZbin's been nice to me lately with recommendations. Fingers crossed.
@10e999
@10e999 3 жыл бұрын
To see a Python KZbin video about actual programming tradeoffs and not just some basic syntax features is like a breath of fresh air! Thanks for your content. Subscribe.
@modsoul
@modsoul 2 жыл бұрын
Agreed. This is a fantastic content. 1st video i've seen from him and subscribed
@azratosh
@azratosh 3 жыл бұрын
Nice and quick explanation! I can actually see Redis being used as a L2 cache, maybe. A decorator that implements something like @functools.lru_cache as L1 cache and @redis_cache.cache_it as L2 would be amazing!
@JackofSome
@JackofSome 3 жыл бұрын
That ... sounds awesome.
@Yoku5
@Yoku5 3 жыл бұрын
As an alternative solution for persistent caching I recommend the DiskCache library. It caches to the file system, so it has slightly different pros and cons compared with redis, but it's quite performant. In addition to a cache decorator it provides a bunch of other useful utilities and can be used in multi-process applications.
@JackofSome
@JackofSome 3 жыл бұрын
Hey thanks for the recommendation. I'll check it out!
@ponysmallhorse
@ponysmallhorse 3 жыл бұрын
Finally I found channel that can actually show me something interesting about python. It has been so long:) Big like on the video.
@JackofSome
@JackofSome 3 жыл бұрын
Thanks for the kind words.
@ponysmallhorse
@ponysmallhorse 3 жыл бұрын
​@@JackofSome Have a question to fellow Experienced Pythonista, how do you feel about Classes in Python? Do you feel like most of the time we can do away with classes? I swear when I read code(which is most of my day) I feel like I can delete 90% of classes and write code in more clear and readable way without them. Problem is that All of my colleagues came from C# and Java and is an up hill battle to make them adapt to best features of Python(They basically still think in Java or C#\++).
@JackofSome
@JackofSome 3 жыл бұрын
There's a great talk by the name of "stop writing classes" that I recommend you watch. I have similar feelings, though maybe not 90 percent. A fair bit of my code is class-less and it's better because of it. The rest I feel is better with classes.
@ponysmallhorse
@ponysmallhorse 3 жыл бұрын
@@JackofSome Exactly the talk that I watched back in 2015 that put me on this path. Right now I think I might went a bit overboard with this, due to interfaces of my libs are classless(and stateless for that matter) and for some people who need to use them I think it might be harder to grasp. Oh well. Great to know there are like mind people out there:)
@JackofSome
@JackofSome 3 жыл бұрын
You can always make a wrapper class 😉
@amr.3k
@amr.3k 3 жыл бұрын
I came from recommindations and I love the straight forward content, no intro, outro, just cs You earned a new subscriber
@nabarundev5092
@nabarundev5092 2 жыл бұрын
Cool stuff. You should add your 5 amazing python libraries video to the python playlist.
@JohnHollowell
@JohnHollowell 3 жыл бұрын
One other huge benefit of redis is not just a cache that persists between running the same program, but a fleet of concurrently running processes that can have a shared cache. Not only does the computation results of one process get shared with all the other processes, but memory demands are reduced using a shared cache rather than several duplicate caches.
@notreallyasloth
@notreallyasloth 2 жыл бұрын
🎉🎉🎉🎉 thank u I was looking for sneering exactly like this
@UrbanGT
@UrbanGT 3 жыл бұрын
Makes sense, thanks :)
@marka9473
@marka9473 Жыл бұрын
I love this video
@JackofSome
@JackofSome Жыл бұрын
This video loves you.
@emmanvries
@emmanvries 3 жыл бұрын
Still, 1.3 seconds... why is redis that slow? (Despite modern computing hardware, etc)
@JackofSome
@JackofSome 3 жыл бұрын
It's not Redis being slow, it's the serialization and IPC overhead for a several hundred megabyte data structure.
@sirius7584
@sirius7584 3 жыл бұрын
redis_cache : persist over scripts
Python is NOT Single Threaded (and how to bypass the GIL)
10:23
Jack of Some
Рет қаралды 110 М.
Человек паук уже не тот
00:32
Miracle
Рет қаралды 4,2 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 45 МЛН
Python and Redis Tutorial - Caching API Responses
32:26
Part Time Larry
Рет қаралды 57 М.
The Fastest Way to Loop in Python - An Unfortunate Truth
8:06
mCoding
Рет қаралды 1,4 МЛН
Five Amazing Python Libraries you should be using!
17:19
Jack of Some
Рет қаралды 76 М.
What is Redis Cache?
6:19
Redis
Рет қаралды 81 М.
Python dataclasses will save you HOURS, also featuring attrs
8:50
Make Python code 1000x Faster with Numba
20:33
Jack of Some
Рет қаралды 446 М.
Cache Invalidation Doesn't Have To Be Hard
12:47
Milan Jovanović
Рет қаралды 14 М.
You Can Do Really Cool Things With Functions In Python
19:47
ArjanCodes
Рет қаралды 224 М.
don't lru_cache methods! (intermediate) anthony explains #382
10:37
anthonywritescode
Рет қаралды 14 М.