Тёмный
No video :(

@lru_cache vs redis-simple-cache in Python 

Jack of Some
Подписаться 30 тыс.
Просмотров 8 тыс.
50% 1

In my Python libraries video there seemed to be some confusion about why redis cache is different from lru_cache or cachetools, so in this video I'm trying to explain the difference a bit more.
The python 3 packages for redis-simple-cache
pypi.org/proje...
pypi.org/proje...
#python #redis #cache
MY OTHER VIDEOS:
○ 5 Python Libraries: • Five Amazing Python Li...
○ 5 Common Python Mistakes: • 5 Things You're Doing ...
○ Learning programming language Julia: • How to learn Julia, a ...
○ Making Python fast: • Can VSCode be a reason...
Subreddit: / jackofsome

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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 года назад
RU-vid's been nice to me lately with recommendations. Fingers crossed.
@10e999
@10e999 3 года назад
To see a Python RU-vid 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 😉
@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.
@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
@notreallyasloth
@notreallyasloth Год назад
🎉🎉🎉🎉 thank u I was looking for sneering exactly like this
@nabarundev5092
@nabarundev5092 2 года назад
Cool stuff. You should add your 5 amazing python libraries video to the python playlist.
@UrbanGT
@UrbanGT 3 года назад
Makes sense, thanks :)
@marka9473
@marka9473 Год назад
I love this video
@JackofSome
@JackofSome Год назад
This video loves you.
@sirius7584
@sirius7584 2 года назад
redis_cache : persist over scripts
@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.
Далее
Make Python code 1000x Faster with Numba
20:33
Просмотров 442 тыс.
You Can Do Really Cool Things With Functions In Python
19:47
Unlocking your CPU cores in Python (multiprocessing)
12:16
C++ in Python the Easy Way! #pybind11
9:57
Просмотров 99 тыс.
Python Decorators in 15 Minutes
15:14
Просмотров 437 тыс.
Five Amazing Python Libraries you should be using!
17:19
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 801 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 353 тыс.