Warning, /graphics/krita/benchmarks/kis_low_memory_benchmark_show_report.m is written in an unsupported language. File is not indexed.

0001 % please run this script in Octave to get the graphs and statistics
0002 
0003 function show_stats(filename, needHold, style, basename)
0004 
0005 data = dlmread(filename);
0006 
0007 numLines = size(data, 1);
0008 
0009 linesArray = zeros(15*20, 5);
0010 linesArrayIndex = 1;
0011 
0012 cyclesArray = zeros(20, 8);
0013 cyclesArrayIndex = 1;
0014 
0015 for i = 1:numLines
0016         if(data(i,2) == 1)
0017                 linesArray(linesArrayIndex,:) = data(i,3:7);
0018                 linesArrayIndex++;
0019         else
0020                 cyclesArray(cyclesArrayIndex,:) = data(i,3:10);
0021                 cyclesArrayIndex++;
0022         endif
0023 endfor
0024 
0025 figure(1);
0026 subplot(2,1,1);
0027 if(needHold == 1)
0028         hold on;
0029 else
0030         hold off;
0031 endif
0032 plot(linesArray(:,3), style);
0033 title("Lines RAM, KiB");
0034 
0035 subplot(2,1,2);
0036 if(needHold == 1)
0037         hold on;
0038 else
0039         hold off;
0040 endif
0041 plot(linesArray(:,2), style);
0042 title("Line running time, ms");
0043 
0044 print(strcat(basename, "_lines.pdf"), "-dpdf");
0045 
0046 figure(2);
0047 subplot(2,1,1);
0048 if(needHold == 1)
0049         hold on;
0050 else
0051         hold off;
0052 endif
0053 plot(cyclesArray(:,3), style);
0054 title("Cycles RAM, KiB");
0055 
0056 subplot(2,1,2);
0057 if(needHold == 1)
0058         hold on;
0059 else
0060         hold off;
0061 endif
0062 plot(cyclesArray(:,2), style);
0063 title("Cycle running time, ms");
0064 
0065 print(strcat(basename, "_cycles.pdf"), "-dpdf");
0066 
0067 meanCycleTime = mean(cyclesArray(:,2));
0068 stdCycleTime = std(cyclesArray(:,2));
0069 meanLineTime = mean(linesArray(:,2));
0070 stdLineTime = std(linesArray(:,2));
0071 
0072 printf("Initial memory level: %f\n", linesArray(1,3));
0073 printf("Cycle time: %f +- %f ms\n", meanCycleTime, stdCycleTime);
0074 printf("Line time: %f +- %f ms\n", meanLineTime, stdLineTime);
0075 printf("\n");
0076 endfunction
0077 
0078 show_stats("./log_0_3000_3000_0_0.txt", 0, '-k', 'report1');
0079 show_stats("./log_1_3000_3000_0_0.txt", 1, '-r', 'report1');
0080 show_stats("./log_1_3000_3000_50_0.txt", 1, '-b', 'report1');