This is a static copy of a profile report

Home

cmxExtract_cpu (Calls: 1, Time: 0.027 sec)
Generated 28-May-2016 14:58:44 using performance time.
function in file /home/johs/work/clustering/src/cmxExtract_cpu.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
AMoG_cpufunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
32
dims(numel(dims)+1) = str2num(...
10.010 s36.3%
2
[~,~,fileSuffix] = fileparts(f...
10.005 s18.1%
35
dims(numel(dims)+1) = str2num(...
10.002 s6.3%
37
nbytePerElement = (str2num(af_...
10.001 s4.4%
31
for i = dim_separators
10.001 s3.7%
All other lines  0.008 s31.2%
Totals  0.027 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
str2numfunction30.005 s20.1%
filepartsfunction10.004 s15.0%
Self time (built-ins, overhead, etc.)  0.017 s64.9%
Totals  0.027 s100% 
Code Analyzer results
Line numberMessage
32The variable 'dims' appears to change size on every loop iteration. Consider preallocating for speed.
32If you are operating on scalar values, consider using STR2DOUBLE for faster performance.
35If you are operating on scalar values, consider using STR2DOUBLE for faster performance.
37If you are operating on scalar values, consider using STR2DOUBLE for faster performance.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)8
Code lines (lines that can run)30
Code lines that did run23
Code lines that did not run7
Coverage (did run/can run)76.67 %
Function listing
time 
Calls 
 line
   1 
function [type, dims, nnumberPerElement, nbytePerElement] = cmxExtract_cpu(filename)
< 0.01 
      1 
   2 
	[~,~,fileSuffix] = fileparts(filename); 
< 0.01 
      1 
   3 
	assert(strncmp(fileSuffix, '.cm', 3)); 
   4 

< 0.01 
      1 
   5 
	underscores = strfind(fileSuffix, '_'); 
< 0.01 
      1 
   6 
	assert(numel(underscores) == 1); 
      1 
   7 
	startOfDims = underscores(1); 
   8 

< 0.01 
      1 
   9 
	af_type = fileSuffix(4:(startOfDims-1)); 
< 0.01 
      1 
  10 
	dim_suffix = fileSuffix((startOfDims+1):end); 
  11 

      1 
  12 
	nnumberPerElement = 1; 
      1 
  13 
	switch af_type(1) 
< 0.01 
      1 
  14 
	case 'c' 
  15 
		type_base='float';
  16 
		nnumberPerElement = 2;
< 0.01 
      1 
  17 
	case 'f' 
      1 
  18 
		type_base='float'; 
  19 
	case 's'
  20 
		type_base='int';
  21 
	case 'u'
  22 
		type_base='uint';
  23 
	end
  24 

< 0.01 
      1 
  25 
	type = [type_base, af_type(2:end)]; 
  26 

< 0.01 
      1 
  27 
	dim_separators = strfind(dim_suffix, 'x'); 
  28 

      1 
  29 
	dims = []; 
      1 
  30 
	prev = 1; 
< 0.01 
      1 
  31 
	for i = dim_separators 
< 0.01 
      1 
  32 
		dims(numel(dims)+1) = str2num(dim_suffix(prev:(i-1))); 
      1 
  33 
		prev = (i+1); 
< 0.01 
      1 
  34 
	end 
< 0.01 
      1 
  35 
	dims(numel(dims)+1) = str2num(dim_suffix(prev:end)); 
  36 

< 0.01 
      1 
  37 
	nbytePerElement = (str2num(af_type(2:end))/8) * nnumberPerElement; 
< 0.01 
      1 
  38 
end