Impact of event delegation.

Number of ngRepeats:

ngClick
ngClick without jqLite
baseline: ng-show
baseline: text interpolation
delegate event directive (only compile)
baseline: noop directive (compile and link)
baseline: no directive

How to read the results:

- The benchmark measures how long it takes to instantiate a given number of directives
- ngClick is compared against ngShow and text interpolation as baseline. The results show how expensive ngClick is compared to other very simple directives that touch the DOM.
- To measure the impact of jqLite.on vs element.addEventListener there is also a benchmark that as a modified version of ngClick that uses element.addEventListener.
- The delegate event directive is compared against a noop directive with a compile and link function and the case with no directives. The result shows how expensive it is to add a link function to a directive, as the delegate event directive has none.

Results as of 7/31/2014:

- ngClick is very close to ngShow and text interpolation, especially when looking at a version of ngClick that does not use jqLite.on but element.addEventListener instead.
- A delegate event directive that has no link function has the same speed as a directive with link function. I.e. ngClick is slower compared to the delegate event directive only because ngClick touches the DOM for every element
- A delegate event directive could be about 50% faster than ngClick. However, the overall performance benefit depends on how many (and which) other directives are used on the same element and what other things are part of the measures use case. E.g. rows of a table with ngRepeat that use ngClick will probably also contain text interpolation.

Debug output:
1 1 1 1
1 1 1 1 1
1 1 1 1 1
{{row}} {{row}} {{row}} {{row}} {{row}}
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1