DEFAULT_CCACHE = "./ccache"
DEFAULT_DIRECTORY = "."
+DEFAULT_HIT_FACTOR = 1
DEFAULT_TIMES = 30
PHASES = [
compiler_args += ["-c", "-o"]
extension = splitext(source_file)[1]
+ hit_factor = options.hit_factor
times = options.times
progress("Creating source code\n")
recreate_dir(obj_dir)
progress("Compiling %s\n" % PHASES[2])
t0 = time()
- for i in range(times):
- run(i, True, False)
- progress(".")
- result[2] = time() - t0
+ for j in range(hit_factor):
+ for i in range(times):
+ run(i, True, False)
+ progress(".")
+ result[2] = (time() - t0) / hit_factor
progress("\n")
###########################################################################
recreate_dir(obj_dir)
progress("Compiling %s\n" % PHASES[4])
t0 = time()
- for i in range(times):
- run(i, True, True)
- progress(".")
- result[4] = time() - t0
+ for j in range(hit_factor):
+ for i in range(times):
+ run(i, True, True)
+ progress(".")
+ result[4] = (time() - t0) / hit_factor
progress("\n")
return result
"--hardlink",
help="use hard links",
action="store_true")
+ op.add_option(
+ "--hit-factor",
+ help="how many times more to compile the file for cache hits (default: %d)" \
+ % DEFAULT_HIT_FACTOR,
+ type="int")
op.add_option(
"--nostats",
help="don't write statistics",
ccache=DEFAULT_CCACHE,
compilercheck="mtime",
directory=DEFAULT_DIRECTORY,
+ hit_factor=DEFAULT_HIT_FACTOR,
times=DEFAULT_TIMES)
(options, args) = op.parse_args(argv[1:])
if len(args) < 2: