Commit ccee19fa authored by norvell's avatar norvell
Browse files

Reorder mem analysis matrix to put all constant buffers at the bottom. This...

Reorder mem analysis matrix to put all constant buffers at the bottom. This emphasizes which buffers are actually constant
parent 5864afcd
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
%%

lines = readlines('mem_analysis.csv');
lines = readlines('mem_analysis.csv','EmptyLineRule','skip');

names = {}; 
Nframes = length(lines);

mem = zeros(1,Nframes);

% Load mem_analysis.csv into matrix
for i = 1:Nframes
    entries = split(lines(i),';');
    for j = 1:length(entries)
@@ -24,6 +25,13 @@ for i = 1:Nframes
    end
end

% Reorder the matrix such that the fixed allocations are at the bottom:
% --> Find all rows which are constant (sum of abs diff is zero). The >0 is
% to limit the reordering to constant values only.
[~,indx] = sort(sum(abs(diff(mem,[],2)),2)>0);
mem = mem(indx,:);
names = names(indx);

bar(mem',1,'stacked')
legend(names,'location','eastoutside','interpreter','none')
xlabel('frame')