summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-10-27 00:32:03 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-10-27 00:32:03 +0000
commit09e87a6622b474d5d3209ae5d276b89779a6c552 (patch)
tree4845801ab7cd178918b31d79947b84f14535c1a2 /lldb
parentd24e7e1d9bce4121e6febe60ea7f4914dd331743 (diff)
downloadbcm5719-llvm-09e87a6622b474d5d3209ae5d276b89779a6c552.tar.gz
bcm5719-llvm-09e87a6622b474d5d3209ae5d276b89779a6c552.zip
Add display of min and max samples to Stopwatch's string representation.
llvm-svn: 143087
Diffstat (limited to 'lldb')
-rw-r--r--lldb/test/bench-history10
-rw-r--r--lldb/test/lldbbench.py17
2 files changed, 24 insertions, 3 deletions
diff --git a/lldb/test/bench-history b/lldb/test/bench-history
index bc8bb181f0a..545d2a68b7c 100644
--- a/lldb/test/bench-history
+++ b/lldb/test/bench-history
@@ -39,3 +39,13 @@ lldb frame variable benchmark: Avg: 1.615647 (Laps: 20, Total Elapsed Time: 32.3
lldb stepping benchmark: Avg: 0.138386 (Laps: 50, Total Elapsed Time: 6.919313)
lldb expr cmd benchmark: Avg: 0.218967 (Laps: 25, Total Elapsed Time: 5.474171)
lldb disassembly benchmark: Avg: 0.092677 (Laps: 10, Total Elapsed Time: 0.926766)
+
+# With patch to lldbbench.py to display min and max of samples.
+[17:27:09] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
+lldb startup delay (create fresh target) benchmark: Avg: 0.103625 (Laps: 30, Total Elapsed Time: 3.108748, min=0.101225, max=0.136308)
+lldb startup delay (set first breakpoint) benchmark: Avg: 0.102321 (Laps: 30, Total Elapsed Time: 3.069623, min=0.101270, max=0.102824)
+lldb startup delay (run to breakpoint) benchmark: Avg: 0.445943 (Laps: 30, Total Elapsed Time: 13.378290, min=0.438535, max=0.475691)
+lldb frame variable benchmark: Avg: 1.612034 (Laps: 20, Total Elapsed Time: 32.240689, min=1.591328, max=1.649720)
+lldb stepping benchmark: Avg: 0.155064 (Laps: 50, Total Elapsed Time: 7.753182, min=0.101287, max=2.028978)
+lldb expr cmd benchmark: Avg: 0.206160 (Laps: 25, Total Elapsed Time: 5.154005, min=0.203282, max=0.224982)
+lldb disassembly benchmark: Avg: 0.032946 (Laps: 10, Total Elapsed Time: 0.329464, min=0.031380, max=0.039198)
diff --git a/lldb/test/lldbbench.py b/lldb/test/lldbbench.py
index b00817de61a..5150ee75ca9 100644
--- a/lldb/test/lldbbench.py
+++ b/lldb/test/lldbbench.py
@@ -1,4 +1,5 @@
import time
+#import numpy
from lldbtest import *
class Stopwatch(object):
@@ -48,6 +49,7 @@ class Stopwatch(object):
self.__start__ = None
self.__stop__ = None
self.__elapsed__ = 0.0
+ self.__nums__ = []
def __init__(self):
self.reset()
@@ -66,6 +68,7 @@ class Stopwatch(object):
elapsed = self.__stop__ - self.__start__
self.__total_elapsed__ += elapsed
self.__laps__ += 1
+ self.__nums__.append(elapsed)
self.__start__ = None # Reset __start__ to be None again.
else:
raise Exception("stop() called without first start()?")
@@ -78,10 +81,18 @@ class Stopwatch(object):
"""Equal to total elapsed time divided by the number of laps."""
return self.__total_elapsed__ / self.__laps__
+ #def sigma(self):
+ # """Return the standard deviation of the available samples."""
+ # if self.__laps__ <= 0:
+ # return None
+ # return numpy.std(self.__nums__)
+
def __str__(self):
- return "Avg: %f (Laps: %d, Total Elapsed Time: %f)" % (self.avg(),
- self.__laps__,
- self.__total_elapsed__)
+ return "Avg: %f (Laps: %d, Total Elapsed Time: %f, min=%f, max=%f)" % (self.avg(),
+ self.__laps__,
+ self.__total_elapsed__,
+ min(self.__nums__),
+ max(self.__nums__))
class BenchBase(TestBase):
"""
OpenPOWER on IntegriCloud