From f65f7051c4bfecc1ab0de8e4b1e27a44b5ea19ad Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 9 Oct 2020 18:39:43 -0700 Subject: [PATCH] improve profiler --- common/profiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/profiler.py b/common/profiler.py index ac28bdac..e4d208ac 100644 --- a/common/profiler.py +++ b/common/profiler.py @@ -36,10 +36,10 @@ class Profiler(): if not self.enabled: return self.iter += 1 - print("******* Profiling *******") + print("******* Profiling %d *******" % self.iter) for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]): if n in self.cp_ignored: - print("%30s: %9.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms/self.tot*100)) + print("%30s: %9.2f avg: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100)) else: - print("%30s: %9.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100)) + print("%30s: %9.2f avg: %7.2f percent: %3.0f" % (n, ms*1000.0, ms*1000.0/self.iter, ms/self.tot*100)) print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))