Static dispatch vs Dynamic dispatch in Swift || iOS interview Questions

preview_player
Показать описание
#appdeveloperpoint
For any queries , feel free to join the discord community.

Follow us on:
Chapters:
0:00 Video Intro
0:15 Overview of Method Dispatch
1:20 Static Dispatch
3:03 Dynamic Dispatch
6:40 Identify Dispatch Type
7:14 Performance comparison
10:29 Tricky Challenge
14:00 Conclusion

You can read more about this topic from here.Contents are referred from this blog. No copyright on images show in this video.
Рекомендации по теме
Комментарии
Автор

A few things you forgot to mention:

1. There are two kinds of table dispatch: virtual table (v-table), and witness table.
2. Why can't Swift just do everything in static (direct) dispatch? - Because you have to pay for features like: inheritance and polymorphism.
3. Value type like 'struct' can conform to protocol and now can be executed with witness table - means at runtime.

The easiest way to understand it is to know what each of them brings to you. So the idea is the smarter the type, the more you have to pay.

saruqara
Автор

00:03 Method dispatch determines which operation should be executed at compile time or runtime
03:45 Table dispatch assigns function pointers in a table.
05:25 Dynamic dispatch involves runtime method invocation based on class hierarchy.
09:00 Using static dispatch is faster than dynamic dispatch.
12:58 Static dispatch is faster than dynamic dispatch

jitendrakumarpradhan
Автор

The best video on this subject! Really really great man!!! Subscribed!

kanerodricks
Автор

Wow! Best Explanation of dispatch differences

dostonbek.rustamov
Автор

Very good, topics, I appreciate your work.

rahuljamba
welcome to shbcf.ru