performance - Why does the Matlab Profiler say there is a bottleneck on the 'end' statement of a 'for' loop? -
so, i've started using matlab's built-in profiler on regular basis, , i've noticed while great @ showing lines taking time, it'll tell me large chunk of time being used on end
statement of for
loop.
now, seeing such line used denoting end of loop, can't imagine how use other trivial amount of processing.
i've seen specific version of question asked on matlab central, consensus didn't seem reached.
edit: here's minimal example of problem:
for =1:1000 x = 1; x = [x 1]; % clear x; end
even if uncomment clear
, end
line still takes lot of computation (about 20%), , clear
increases absolute amount of computation performed end line.
when i've seen in code, it's been deallocation of large temporaries created in loop. each new variable created in loop deallocated @ end
.
Comments
Post a Comment