def _benchmark_compilation(self, iterations=50):
    number = 1
    outputs = []

    def bench_func():
        outputs.append(self._run_jhaskell_compiler(['--time-stages']).decode())
    overall_times = timeit.repeat(stmt=bench_func, setup=self._pre_compile, number=number, repeat=iterations)
    time_data = []
    data_extractor = re.compile('(.+): (.+)ms')
    for (output, overall_time) in zip(outputs, overall_times):
        cumulative_time = 0
        this_run_data = []
        for line in output.splitlines():
            match = data_extractor.fullmatch(line)
            if (match is None):
                raise RuntimeError(('Invalid line from compiler: ' + line))
            this_time = float(match.group(2))
            this_run_data.append((match.group(1), this_time))
            cumulative_time += this_time
        time_data.append(this_run_data)
    self._results['times'] = time_data
def _benchmark_compilation(self, iterations=50):
    number = 1
    outputs = []

    def bench_func():
        outputs.append(self._run_jhaskell_compiler(['--time-stages']).decode())
    overall_times = timeit.repeat(stmt=bench_func, setup=self._pre_compile, number=number, repeat=iterations)
    time_data = []
    data_extractor = re.compile('(.+): (.+)ms')
    for (output, overall_time) in zip(outputs, overall_times):
        cumulative_time = 0
        this_run_data = []
        for line in output.splitlines():
            match = data_extractor.fullmatch(line)
            if (match is None):
                raise RuntimeError(('Invalid line from compiler: ' + line))
            this_time = float(match.group(2))
            this_run_data.append((match.group(1), this_time))
            cumulative_time += this_time
        time_data.append(this_run_data)
    self._results['times'] = time_data