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

Closes #8741

ggershoni/angular.js,ggershoni/angular.js,ggershoni/angular.js,ggershoni/angular.js