Tail Call Optimization

preview_player
Показать описание
We hear about tail calls from time to time in the world of programming, and how they can be optimized for performance. What exactly is that, and how would such optimization work? Today, we take a closer look at tail calls, in addition to a common use case - Tail call recursion!

= Contents Page =
0:00 Introduction
0:42 Contents Page
1:13 Foundation: Code and RAM
1:59 Functions and RAM
2:22 The "Return" Problem
2:57 The Call Stack
4:06 Introduction to Tail Calls
4:39 Need for Tail Call Optimization
5:27 Tail Call Optimization
6:14 Tail Call Recursion
7:14 Benefits of Tail Calls
8:02 Conclusion

= 0612 TV =

Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!



= NERDfirst =
NERDfirst is a project allowing me to go above and beyond YouTube videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.


-----

Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.
Рекомендации по теме
Комментарии
Автор

This is near enough the only effective introduction to this topic on the internet. Thank you!

cameronmackinnon
Автор

Most underrated programming channel I have come across so far! Super clear explanations -- thank you!

blackswan
Автор

This is the only video I found that best explain the topic!!!
Thx A LOT

包軟體工程之路
Автор

Thank you veeeery much for this video!!!! I’ve been seraching all this stuff anywhere, but only your video was that best one which could explain what I wanted exactly. Such a short but very meaningful video, excellent, thank you again:)

lilitghazaryan
Автор

Great explanation - thank you very much.

Jan_Jan_
Автор

excellent - Interesting. A good teacher with a good understanding of the topic. Never heard of it but now fully understood.

okay
Автор

Unsung YT hero! ✨You're a legend, mate! 👑 One of my favourite videos of yours: Priceless for anyone interested in optimization as long as TCO is implemented in your programming language of choice.

shoshonu
Автор

That`s the best explanation on the subject i`ve seen so far. I was watching a couple of videos and yours have the best bottom-up explanation. Only thing i found lacking was some examples with popular recursive functions (like factorial or fibonacci sequence)

shimadabr
Автор

Explanation was very clear. Props to you.

bywavy
Автор

Just saw your vid from 2014 about serialization. Very concise, and direct, and informative. I originally was searching for what pickling is in Python. You made serialization so easy to understand, that I was able to extract the info and relate it to Python pickle function even though you did not even mention it. Excellent job!

ballafolife
Автор

Thanks for this awesome content. Great illustrations. Simple is beautiful. All the best. 😊

SandeepKumar
Автор

Thank you for this clear and informative video. The only thing I would add is perhaps a simple summary statement: A recursive function in which the recursive call is the last statement in the function can be rewritten by the optimizer to use iteration instead of recursion. Doing so reduces the stack memory used by the function and increases the runtime execution speed. It may, however, slightly increase the size of the function executable.

shadetreesam
Автор

Great video. So, if a recursive function is tc optimized, does that mean that stack allocated memory for the function is only allocated once (and reused for all recursive calls)?

jeffg
Автор

Thanks for the overview, this is one of those terms I've certainly heard and had a vague familiarity with but this really brought it into focus.

Given the rising popularity of functional composition I can see why being able to optimize deeply nested calls would be a real boon!

Eyetrauma
Автор

Still unclear to me why you wouldn't have 25 call stacks in memory if you did recursion 25 times..I guess they are just clearing out local variables and the call stack early, is that it?

nyahhbinghi
Автор

what software do you use to make your animations/powerpoint slides?

bearsbarebears
welcome to shbcf.ru