perf($compile): only iterate over elements with link functions

I've been thinking about this a while and @IgorMinar added a TODO for it in 3e0a2e1f.

In a quick test I found this lowered the link time 5-10% for a table row with only ~2/15 cells requiring linking. For DOM trees with a higher percentage of annotated nodes this shouldn't have any noticeable effect. However I think having 50%+ non-annotated nodes is very common (a newline/whitespace text node per element...).
you are creating sparse arrays here. that will disable all major array optimizations in the VM. we need to avoid that.