How does SendMessage work in the background?

It looks like every time a message is sent it iterates through all the components looking for the function. Is that true or does it do some clever optimization in the background, As in maintaining a look up table of some sort?

Send Message will indeed use reflection internally. So, it is by no means as fast as some custom solution using delegate tables. If you use this a lot, replacing it makes a lot of sense.

I believe it internally uses some sort of delegate system - however, despite whatever optimizations it may or may not use, it is slow (relatively).

If you are interested for optimization purposes, the answer is that using SendMessage every frame (such as in Update) is not a good idea on things like the iPhone.

I thing messages is based on "Invoke" method/ Not so fast as delegats.