l-lin/angular-datatables — pull request #144 by Robinson7D (2014-12-09 15:49:31+00:00)
Title: Improve Angular digest performance by watching dtOptions more shallowly

`$watch` with third argument set to `true` causes a deep search for changes on every `$digest` cycle. Meaning every time any Angular event happens (ng-clicks, etc.), the entire array, each of it's children, it's children's children, and so forth gets compared to a cached copy.

This seems unnecessary for `dtOptions`, and can cause some slowdown when dealing with very large datasets (or otherwise just if the dataset has a lot of deeply nested fields to traverse).

I left `columns` and `columnDefs` in full watch because they're typically much smaller, didn't seem as immediately important.

This change allowed several pages on a current project of mine to move from ~750ms to ~20ms digest cycles.

------------------------------------------------------------------

Flame charts from Chrome profiling to show the difference attached below:

Before:

![screen shot 2014-12-09 at 10 44 42 am](https://cloud.githubusercontent.com/assets/1261701/5360229/ebf306ba-7f90-11e4-8d38-f0c0e48a43c0.png)

After:

![screen shot 2014-12-09 at 10 43 15 am](https://cloud.githubusercontent.com/assets/1261701/5360235/f94387e0-7f90-11e4-8aa2-51ef2a0a7ed9.png)