Add the real benchmarks comparing lldb against gdb for repeated expression evaluations.
Modify lldbbench.py so that lldbtest.line_number() utility function is available to
BenchBase client as just line_number(), and modify lldbtest.py so that self.lldbExec
(the full path for the 'lldb' executable) is available to BenchBase client as well.
An example run of the test case on my MacBook Pro running Lion:
1: test_compare_lldb_to_gdb (TestRepeatedExprs.RepeatedExprsCase)
Test repeated expressions with lldb vs. gdb. ...
lldb_avg: 0.204339
gdb_avg: 0.205721
lldb_avg/gdb_avg: 0.993284
ok
llvm-svn: 136740
diff --git a/lldb/test/lldbbench.py b/lldb/test/lldbbench.py
index 4bc220b..e0c7814 100644
--- a/lldb/test/lldbbench.py
+++ b/lldb/test/lldbbench.py
@@ -1,6 +1,7 @@
import time
-from lldbtest import benchmarks_test
from lldbtest import Base
+from lldbtest import benchmarks_test
+from lldbtest import line_number
class Stopwatch(object):
"""Stopwatch provides a simple utility to start/stop your stopwatch multiple
@@ -80,7 +81,7 @@
return self.__total_elapsed__ / self.__laps__
def __str__(self):
- return "Avg: %f (Laps: %d, Total Elapsed Time: %d)" % (self.avg(),
+ return "Avg: %f (Laps: %d, Total Elapsed Time: %f)" % (self.avg(),
self.__laps__,
self.__total_elapsed__)