The code is:
def slide_merge_forloop(rc1u,rc2wr):
ret1 = []
rc1ulen = len(rc1u)
rc2wrlen = len(rc2wr)
for i in xrange(min (rc1ulen, rc2wrlen)):
if rc1u[i] == rc2wr[i]:
ret1.append(rc1u[i])
elif rc1u[i] == 'N':
ret1.append(rc1u[i])
elif rc2wr[i] == 'N':
ret1.append(rc2wr[i])
else:
break
return ret1
Below is the output from profiling this function as part of the main code, gained whilst using profilehooks as the profiling tool:
*** PROFILER RESULTS ***
slide_merge_forloop (Early_matcher.py:73)
function called 224794 times
1181922 function calls in 1.004 seconds
Ordered by: cumulative time, internal time, call count
ncalls tottime percall cumtime percall filename:lineno(function)
224794 0.817 0.000 0.980 0.000 Early_matcher.py:73(slide_merge_forloop)
224794 0.097 0.000 0.097 0.000 {min}
449588 0.052 0.000 0.052 0.000 {len}
224794 0.024 0.000 0.024 0.000 {method 'disable' of '_lsprof.Profiler' objects}
57952 0.014 0.000 0.014 0.000 {method 'append' of 'list' objects}
0 0.000 0.000 profile:0(profiler)
Obviously I wish to speed up the code but the part I have issue with is what does the {min} part mean? I dont call such thing at all during this part of my code and yet it is taking up a significant amount of time. I have the same issue with the "method 'disable' " section as I do not understand what that is either.
Any help in understanding this output would be greatly appreciated.