Garbage Collection in Python: Speed Up Your Code

preview_player
Показать описание
Today we will learn about garbage collection in Python. How it is done and what we can do manually, in order to speed up our code.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

💼 Services 💼

🌐 Social Media & Contact 🌐
Рекомендации по теме
Комментарии
Автор

Great video. You always give me new knowledge to improve my Python code and don't just settle in the "if it works, don't touch it" mindset.

lowkeygaming
Автор

Really interesting topic. Do you have a video about how memory in python implemented? (about heaps, stacks, references to objects etc.)

dangalimov
Автор

Please keep doing these, you explain things really well and thoroughly!

ventsiR
Автор

Thank you for the video man. Cleared a lot of my querries in just 15 minutes.

albertwayadav
Автор

great topic to touch on!
other than the speedup benefits, there are consequences as well if we disable garbage collection: memory leaks, manual management is hard.

I also agree with some comments pointing out using gc.collect() manually in a running function makes it slower.

pietraderdetective
Автор

Thank you very much! A great short video really helped me understand GC in python.

terrygmx
Автор

Thanks for the interesting video's. Have a nice 2024!

MichielJ
Автор

great topic and review, as always, keep it up pybro :)

PhoebusG
Автор

at 3:53 a reference to L1 from L3 doesn't seem to matter right?

malakarakesh
Автор

Great video, thank you for making it. Probably not a use-case for me but nonetheless I found the whole topic fascinating, and really well explained. Please consider covering more of these "under the hood" topics.
For about a year I struggled to learn C++ (I'm only a hobbyist) thinking all the while that Python was a bit "mickey mouse". Then I came back to it when I realised that pretty much everything I would want to do was more than catered for in Python. OK, so the trade-off is speed - but that's fine for me, and easily outweighs the fairly complex tool chains that are required for C++.

skf
Автор

Awesome explanation. I've a question. When do you suggest to manually turn off GC and what will be the benefits? Say I'm processing a huge set of data and creating a new structure. The size of set is 80K. Now turning of GC will speed up the process but will increase the memory usage. So when should we consider the manual approach?

wannahidemyname
Автор

very interesting thanks a lot. Now I am curious how it's gonna file in a real system with `celery workers` etc.

anton-r
Автор

which video editor you use in pop os, i am getting problem in installing Davinci resolve. Can you help?

ashisdvpandey
Автор

Do context managers help to avoid unnecessary garbage in memory?

gsm
Автор

Who’s code did you rip of this time? Who’s comment did you delete?

TomKnudsen
join shbcf.ru