So, I have this rather large application built on angular, many nested states, many directives, data tables, etc.
Recently, we decided to go to a full single page, instead of having several small separate sections of applications (for example, articles, people, the toolbar were small one-page applications earlier), so I started working with performance a bit more. On the other hand, in Chrome you did not notice anything, but on the other hand, I think that over time it becomes slower.
So, I started with three snapshot labels to see what was happening. But I'm not quite sure what to do about it.
PICTURE 

- image size doubles the size of each image (1st 15mb, 2nd 67mb, 3rd 120mb), does that mean anything?
- there are a lot of red dom, 4000 red divs for example
Now I feel that these red divs, spans and snaps are basically my mistake, I am doing some unusual things to render these data tables using this directive that I did, and also feel that part of the heap objects are the result of that dom elements are not removed properly.
This is what the table directive essentially does
var rows = '<div class="row" ng-repeat="item in items">'; _.each(columns, function(column) { // pass cell as a string from $templateCache, instead of having <table-cell type="column.type"> which loaded correct templateUrl depending on what was passed via type attr var cellTemplate = $templateCache.get(column.type); rows += '<div class="column">' + cellTemplate + '</div>'; }); rows += '</div>'; // el is from directive link function el.html(rows); $compile(el.contents())(scope);
The reason I do this in general is that when I tried to use nested ng-repeat for rows and columns and the <table-cell> directive for cells, it was too long for rendering, even with about 6 columns and 50 lines.
So, I think this is due to the fact that none of these divs inside this table are deleted properly, so they constantly accumulate every time this table loads.
Now, even if I am dealing with this freestanding tree. What about everything else, as I know what I should try to handle and what is usually for angular and does not affect performance
// change the table directive to plunker http://plnkr.co/edit/1fZi6mVn2jBIGF0Q2a40?p=preview