提交 961d616f authored 作者: Razvan Pascanu's avatar Razvan Pascanu

add the node id in the printouts to be able to link the timing with the

graph
上级 a9272dfa
...@@ -298,6 +298,9 @@ class ProfileStats(object): ...@@ -298,6 +298,9 @@ class ProfileStats(object):
hs += ['<#call>'] hs += ['<#call>']
es += [' %4d '] es += [' %4d ']
hs += ['<id>']
es += ['%3d']
upto_length = numpy.sum([len(x) for x in hs]) + len(hs) upto_length = numpy.sum([len(x) for x in hs]) + len(hs)
maxlen = self.line_width - upto_length maxlen = self.line_width - upto_length
hs += ['<Apply name>'] hs += ['<Apply name>']
...@@ -312,17 +315,19 @@ class ProfileStats(object): ...@@ -312,17 +315,19 @@ class ProfileStats(object):
t*100/local_time, t*100/local_time,
t, t,
a, a,
a.env.toposort().index(a),
self.apply_callcount[a]) self.apply_callcount[a])
for a, t in self.apply_time.items()] for a, t in self.apply_time.items()]
atimes.sort() atimes.sort()
atimes.reverse() atimes.reverse()
tot=0 tot=0
for (f, t, a, nb_call) in atimes[:N]: for (f, t, a, nd_id, nb_call) in atimes[:N]:
tot+=t tot+=t
ftot=tot*100/local_time ftot=tot*100/local_time
if nb_call==0: if nb_call==0:
continue continue
print >> file, format_str %(f,ftot, t, t/nb_call, nb_call, print >> file, format_str %(f,ftot, t, t/nb_call, nb_call,
nd_id,
str(a)[:maxlen]) str(a)[:maxlen])
# Same as before, this I've sacrificied some information making # Same as before, this I've sacrificied some information making
# the output more readable # the output more readable
...@@ -330,8 +335,8 @@ class ProfileStats(object): ...@@ -330,8 +335,8 @@ class ProfileStats(object):
# f, ftot, t, tot, t/nb_call,nb_call, str(a)) # f, ftot, t, tot, t/nb_call,nb_call, str(a))
print >> file, ' ... (remaining %i Apply instances account for %.2f%%(%.2fs) of the runtime)'\ print >> file, ' ... (remaining %i Apply instances account for %.2f%%(%.2fs) of the runtime)'\
%(max(0, len(atimes)-N), %(max(0, len(atimes)-N),
sum(f for f, t, a, nb_call in atimes[N:]), sum(f for f, t, a, nd_id, nb_call in atimes[N:]),
sum(t for f, t, a, nb_call in atimes[N:])) sum(t for f, t, a, nd_id, nb_call in atimes[N:]))
print >> file, '' print >> file, ''
def summary_function(self, file): def summary_function(self, file):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论