diff options
author | Marco Poletti <poletti.marco@gmail.com> | 2020-05-02 12:15:10 -0700 |
---|---|---|
committer | Marco Poletti <poletti.marco@gmail.com> | 2020-05-02 12:15:15 -0700 |
commit | af6fb8328f35b493fac0e1196879af01469699bb (patch) | |
tree | 025d861b44b7db005d41683cf5aa63880482a90f /extras | |
parent | b0fee156740001614e2834f0728d703a0a0e713d (diff) | |
download | google-fruit-af6fb8328f35b493fac0e1196879af01469699bb.tar.gz |
Add dockerfiles for Ubuntu 20.04.
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/benchmark/format_bench_results.py | 61 | ||||
-rwxr-xr-x | extras/benchmark/run_benchmarks.py | 2 | ||||
-rw-r--r-- | extras/benchmark/tables/fruit_internal.yml | 710 | ||||
-rw-r--r-- | extras/dockerfiles/Dockerfile.ubuntu-20.04 | 9 | ||||
-rwxr-xr-x | extras/dockerfiles/rebuild_all.sh | 2 | ||||
-rw-r--r-- | extras/dockerfiles/ubuntu-20.04_custom.list | 0 | ||||
-rw-r--r-- | extras/dockerfiles/ubuntu-20.04_install.sh | 31 |
7 files changed, 677 insertions, 138 deletions
diff --git a/extras/benchmark/format_bench_results.py b/extras/benchmark/format_bench_results.py index 6a33781..614db07 100755 --- a/extras/benchmark/format_bench_results.py +++ b/extras/benchmark/format_bench_results.py @@ -25,10 +25,13 @@ def extract_results(bench_results: List[Dict[str, Dict[Any, Any]]], column_dimension: str, row_dimension: str, result_dimension: str) -> Tuple[Dict[str, Dict[str, Dict[str, Any]]], - Set[Tuple[List[Tuple[str, str]], ...]]]: + Set[Tuple[List[Tuple[str, str]], ...]], + Set[Tuple[Tuple[List[Tuple[str, str]], ...], + str]]]: table_data = defaultdict(lambda: dict()) # type: Dict[str, Dict[str, Dict[str, Any]]] remaining_dimensions_by_row_column = dict() used_bench_results = set() # type: Set[Tuple[List[Tuple[str, str]], ...]] + used_bench_result_values = set() # type: Set[Tuple[Tuple[List[Tuple[str, str]], ...], str]] for bench_result in bench_results: try: params = {dimension_name: make_immutable(dimension_value) @@ -51,6 +54,8 @@ def extract_results(bench_results: List[Dict[str, Dict[Any, Any]]], assert column_dimension in params.keys(), '%s not in %s' % (column_dimension, params.keys()) assert result_dimension in results, '%s not in %s' % (result_dimension, results) used_bench_results.add(tuple(sorted(original_params.items()))) + used_bench_result_values.add((tuple(sorted(original_params.items())), + result_dimension)) row_value = params[row_dimension] column_value = params[column_dimension] remaining_dimensions = params.copy() @@ -60,13 +65,13 @@ def extract_results(bench_results: List[Dict[str, Dict[Any, Any]]], previous_remaining_dimensions = remaining_dimensions_by_row_column[(row_value, column_value)] raise Exception( 'Found multiple benchmark results with the same fixed benchmark params, benchmark param for row and benchmark param for column, so a result can\'t be uniquely determined. ' - + 'Consider adding additional values in fixed_benchmark_params. Remaining dimensions: %s vs %s' % ( + + 'Consider adding additional values in fixed_benchmark_params. Remaining dimensions:\n%s\nvs\n%s' % ( remaining_dimensions, previous_remaining_dimensions)) table_data[row_value][column_value] = results[result_dimension] remaining_dimensions_by_row_column[(row_value, column_value)] = remaining_dimensions except Exception as e: raise Exception('While processing %s' % bench_result) from e - return table_data, used_bench_results + return table_data, used_bench_results, used_bench_result_values # Takes a 2-dimensional array (list of lists) and prints a markdown table with that content. def print_markdown_table(table_data: List[List[str]]) -> None: @@ -133,16 +138,17 @@ def print_confidence_intervals_table(table_name, baseline_table_data, column_header_pretty_printer: DimensionPrettyPrinter, row_header_pretty_printer: DimensionPrettyPrinter, - value_pretty_printer: IntervalPrettyPrinter): + value_pretty_printer: IntervalPrettyPrinter, + row_sort_key: Callable[[Any], Any]): if table_data == {}: print('%s: (no data)' % table_name) return - row_headers = sorted(list(table_data.keys())) + row_headers = sorted(list(table_data.keys()), key=row_sort_key) # We need to compute the union of the headers of all rows; some rows might be missing values for certain columns. column_headers = sorted(set().union(*[list(row_values.keys()) for row_values in table_data.values()])) if baseline_table_data: - baseline_row_headers = sorted(list(baseline_table_data.keys())) + baseline_row_headers = sorted(list(baseline_table_data.keys()), key=row_sort_key) baseline_column_headers = sorted(set().union(*[list(row_values.keys()) for row_values in baseline_table_data.values()])) unmached_baseline_column_headers = set(baseline_row_headers) - set(row_headers) if unmached_baseline_column_headers: @@ -186,6 +192,11 @@ def format_string_pretty_printer(format_string: str) -> Callable[[str], str]: return pretty_print +def float_to_str(x: float) -> str: + if x > 100: + return str(int(x)) + else: + return '%.2g' % x def interval_pretty_printer(interval: Interval, unit: str, multiplier: float) -> str: interval = list(interval) # type: List[Any] @@ -198,11 +209,11 @@ def interval_pretty_printer(interval: Interval, unit: str, multiplier: float) -> if int(interval[0]) == interval[0] and interval[0] >= 10: interval[0] = int(interval[0]) else: - interval[0] = '%.3g' % interval[0] + interval[0] = float_to_str(interval[0]) if int(interval[1]) == interval[1] and interval[1] >= 10: interval[1] = int(interval[1]) else: - interval[1] = '%.3g' % interval[1] + interval[1] = float_to_str(interval[1]) if interval[0] == interval[1]: return '%s %s' % (interval[0], unit) @@ -294,6 +305,13 @@ def determine_column_pretty_printer(pretty_printer_definition: Dict[str, Any]) - def determine_row_pretty_printer(pretty_printer_definition: Dict[str, Any]) -> DimensionPrettyPrinter: return determine_column_pretty_printer(pretty_printer_definition) +def determine_row_sort_key(pretty_printer_definition: Dict[str, Any]) -> Callable[[Any], Any]: + if 'fixed_map' in pretty_printer_definition: + indexes = {x: i for i, x in enumerate(pretty_printer_definition['fixed_map'].keys())} + return lambda s: indexes[s] + + return lambda x: x + def determine_value_pretty_printer(unit: str) -> IntervalPrettyPrinter: if unit == "seconds": return time_interval_pretty_printer @@ -327,18 +345,22 @@ def main(): with open(args.benchmark_tables_definition, 'r') as f: used_bench_results = set() - for table_definition in yaml.safe_load(f)["tables"]: + # Set of (Benchmark definition, Benchmark result name) pairs + used_bench_result_values = set() + config = yaml.full_load(f) + for table_definition in config["tables"]: try: fixed_benchmark_params = {dimension_name: make_immutable(dimension_value) for dimension_name, dimension_value in table_definition['benchmark_filter'].items()} - table_data, last_used_bench_results = extract_results( + table_data, last_used_bench_results, last_used_bench_result_values = extract_results( bench_results, fixed_benchmark_params=fixed_benchmark_params, column_dimension=table_definition['columns']['dimension'], row_dimension=table_definition['rows']['dimension'], result_dimension=table_definition['results']['dimension']) used_bench_results = used_bench_results.union(last_used_bench_results) + used_bench_result_values = used_bench_result_values.union(last_used_bench_result_values) if baseline_bench_results: - baseline_table_data, _ = extract_results( + baseline_table_data, _, _ = extract_results( baseline_bench_results, fixed_benchmark_params=fixed_benchmark_params, column_dimension=table_definition['columns']['dimension'], @@ -354,18 +376,29 @@ def main(): baseline_table_data, column_header_pretty_printer=determine_column_pretty_printer(columns_pretty_printer_definition), row_header_pretty_printer=determine_row_pretty_printer(rows_pretty_printer_definition), - value_pretty_printer=determine_value_pretty_printer(results_unit)) + value_pretty_printer=determine_value_pretty_printer(results_unit), + row_sort_key=determine_row_sort_key(rows_pretty_printer_definition)) print() print() except Exception as e: print('While processing table:\n%s' % table_definition) print() raise e + allowed_unused_benchmarks = set(config.get('allowed_unused_benchmarks', [])) + allowed_unused_benchmark_results = set(config.get('allowed_unused_benchmark_results', [])) for bench_result in bench_results: params = {dimension_name: make_immutable(dimension_value) for dimension_name, dimension_value in bench_result['benchmark'].items()} - if tuple(sorted(params.items())) not in used_bench_results: - print('Warning: benchmark result did not match any tables: %s' % params) + benchmark_defn = tuple(sorted(params.items())) + if benchmark_defn not in used_bench_results: + if params['name'] not in allowed_unused_benchmarks: + print('Warning: benchmark result did not match any tables: %s' % params) + else: + unused_result_dimensions = {result_dimension + for result_dimension in bench_result['results'].keys() + if (benchmark_defn, result_dimension) not in used_bench_result_values and result_dimension not in allowed_unused_benchmark_results} + if unused_result_dimensions: + print('Warning: unused result dimensions %s in benchmark result %s' % (unused_result_dimensions, params)) if __name__ == "__main__": diff --git a/extras/benchmark/run_benchmarks.py b/extras/benchmark/run_benchmarks.py index 0bddbc7..1fc3fd4 100755 --- a/extras/benchmark/run_benchmarks.py +++ b/extras/benchmark/run_benchmarks.py @@ -752,7 +752,7 @@ def main(): fruit_build_dir = tempfile.gettempdir() + '/fruit-benchmark-build-dir' with open(args.benchmark_definition, 'r') as f: - yaml_file_content = yaml.safe_load(f) + yaml_file_content = yaml.full_load(f) global_definitions = yaml_file_content['global'] benchmark_definitions = expand_benchmark_definitions(yaml_file_content['benchmarks']) diff --git a/extras/benchmark/tables/fruit_internal.yml b/extras/benchmark/tables/fruit_internal.yml index 2649398..dfc7a27 100644 --- a/extras/benchmark/tables/fruit_internal.yml +++ b/extras/benchmark/tables/fruit_internal.yml @@ -16,179 +16,283 @@ constants: pretty_printer: format_string: "%s" +allowed_unused_benchmarks: + - new_delete_run_time + - fruit_single_file_compile_time + +allowed_unused_benchmark_results: + - total_max_ram_usage + tables: - - name: "Fruit compile time (single file)" - benchmark_filter: - name: "fruit_single_file_compile_time" - benchmark_generation_flags: [] - additional_cmake_args: [] - columns: *num_bindings_column - rows: *compiler_name_row - results: - dimension: "compile_time" - unit: "seconds" - - - name: "Fruit compile time" + + # Fruit vs Boost.DI and "no DI" + + - name: "Compile time (Clang)" benchmark_filter: - name: "fruit_compile_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "clang++-10" + name: [ + "fruit_compile_time", + "boost_di_compile_time", + "simple_di_compile_time", + "simple_di_with_interfaces_compile_time", + "simple_di_with_interfaces_and_new_delete_compile_time", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_compile_time": "Fruit" + "boost_di_compile_time": "Boost.DI" + "simple_di_compile_time": "Simple DI" + "simple_di_with_interfaces_compile_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_compile_time": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: dimension: "compile_time" unit: "seconds" - - name: "Fruit incremental compile time" + - name: "Compile time (GCC)" benchmark_filter: - name: "fruit_incremental_compile_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "g++-9" + name: [ + "fruit_compile_time", + "boost_di_compile_time", + "simple_di_compile_time", + "simple_di_with_interfaces_compile_time", + "simple_di_with_interfaces_and_new_delete_compile_time", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_compile_time": "Fruit" + "boost_di_compile_time": "Boost.DI" + "simple_di_compile_time": "Simple DI" + "simple_di_with_interfaces_compile_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_compile_time": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: dimension: "compile_time" unit: "seconds" - - name: "Fruit full injection time" + - name: "Incremental compile time (Clang)" benchmark_filter: - name: "fruit_run_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "clang++-10" + name: [ + "fruit_incremental_compile_time", + "boost_di_incremental_compile_time", + "simple_di_incremental_compile_time", + "simple_di_with_interfaces_incremental_compile_time", + "simple_di_with_interfaces_and_new_delete_incremental_compile_time", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_incremental_compile_time": "Fruit" + "boost_di_incremental_compile_time": "Boost.DI" + "simple_di_incremental_compile_time": "Simple DI" + "simple_di_with_interfaces_incremental_compile_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_incremental_compile_time": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: - dimension: "Full injection time" + dimension: "incremental_compile_time" unit: "seconds" - - name: "Fruit component normalization time" + - name: "Incremental compile time (GCC)" benchmark_filter: - name: "fruit_run_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "g++-9" + name: [ + "fruit_incremental_compile_time", + "boost_di_incremental_compile_time", + "simple_di_incremental_compile_time", + "simple_di_with_interfaces_incremental_compile_time", + "simple_di_with_interfaces_and_new_delete_incremental_compile_time", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_incremental_compile_time": "Fruit" + "boost_di_incremental_compile_time": "Boost.DI" + "simple_di_incremental_compile_time": "Simple DI" + "simple_di_with_interfaces_incremental_compile_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_incremental_compile_time": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: - dimension: "componentNormalizationTime" + dimension: "incremental_compile_time" unit: "seconds" - - name: "Fruit setup time" + - name: "Compile memory (Clang)" benchmark_filter: - name: "fruit_run_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "clang++-10" + name: [ + "fruit_compile_memory", + "boost_di_compile_memory", + "simple_di_compile_memory", + "simple_di_with_interfaces_compile_memory", + "simple_di_with_interfaces_and_new_delete_compile_memory", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_compile_memory": "Fruit" + "boost_di_compile_memory": "Boost.DI" + "simple_di_compile_memory": "Simple DI" + "simple_di_with_interfaces_compile_memory": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_compile_memory": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: - dimension: "Total for setup" - unit: "seconds" + dimension: "max_ram_usage" + unit: "bytes" - - name: "Fruit per-request time" + - name: "Compile memory (GCC)" benchmark_filter: - name: "fruit_run_time" benchmark_generation_flags: [] additional_cmake_args: [] + compiler: "g++-9" + name: [ + "fruit_compile_memory", + "boost_di_compile_memory", + "simple_di_compile_memory", + "simple_di_with_interfaces_compile_memory", + "simple_di_with_interfaces_and_new_delete_compile_memory", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_compile_memory": "Fruit" + "boost_di_compile_memory": "Boost.DI" + "simple_di_compile_memory": "Simple DI" + "simple_di_with_interfaces_compile_memory": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_compile_memory": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: - dimension: "Total per request" - unit: "seconds" - - - name: "New/delete time" - benchmark_filter: - name: "new_delete_run_time" + dimension: "max_ram_usage" + unit: "bytes" + + - name: "Startup time (Clang)" + benchmark_filter: + compiler: "clang++-10" benchmark_generation_flags: [] additional_cmake_args: [] + name: [ + "fruit_startup_time", + "boost_di_startup_time", + "simple_di_startup_time", + "simple_di_with_interfaces_startup_time", + "simple_di_with_interfaces_and_new_delete_startup_time", + ] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_startup_time": "Fruit" + "boost_di_startup_time": "Boost.DI" + "simple_di_startup_time": "Simple DI" + "simple_di_with_interfaces_startup_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_startup_time": "Simple DI w/ interfaces, new/delete" columns: *num_classes_column - rows: *compiler_name_row results: - dimension: "Total" + dimension: "startup_time" unit: "seconds" - - - name: "Compile time (100 classes)" + + - name: "Startup time (GCC)" benchmark_filter: - num_classes: 100 + compiler: "g++-9" benchmark_generation_flags: [] additional_cmake_args: [] name: [ - "fruit_compile_time", - "boost_di_compile_time", - "simple_di_compile_time", - "simple_di_with_interfaces_compile_time", - "simple_di_with_interfaces_and_new_delete_compile_time", + "fruit_startup_time", + "boost_di_startup_time", + "simple_di_startup_time", + "simple_di_with_interfaces_startup_time", + "simple_di_with_interfaces_and_new_delete_startup_time", ] - columns: + rows: dimension: "name" pretty_printer: fixed_map: - "fruit_compile_time": "Fruit" - "boost_di_compile_time": "Boost.DI" - "simple_di_compile_time": "Simple DI" - "simple_di_with_interfaces_compile_time": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_compile_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "fruit_startup_time": "Fruit" + "boost_di_startup_time": "Boost.DI" + "simple_di_startup_time": "Simple DI" + "simple_di_with_interfaces_startup_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_startup_time": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column results: - dimension: "compile_time" + dimension: "startup_time" unit: "seconds" - - - name: "Incremental compile time (100 classes)" + + - name: "Startup time with normalized component (Clang)" benchmark_filter: - num_classes: 100 + compiler: "clang++-10" benchmark_generation_flags: [] additional_cmake_args: [] name: [ - "fruit_incremental_compile_time", - "boost_di_incremental_compile_time", - "simple_di_incremental_compile_time", - "simple_di_with_interfaces_incremental_compile_time", - "simple_di_with_interfaces_and_new_delete_incremental_compile_time", + "fruit_startup_time_with_normalized_component", + "boost_di_startup_time_with_normalized_component", + "simple_di_startup_time_with_normalized_component", + "simple_di_with_interfaces_startup_time_with_normalized_component", + "simple_di_with_interfaces_and_new_delete_startup_time_with_normalized_component", ] - columns: + rows: dimension: "name" pretty_printer: fixed_map: - "fruit_incremental_compile_time": "Fruit" - "boost_di_incremental_compile_time": "Boost.DI" - "simple_di_incremental_compile_time": "Simple DI" - "simple_di_with_interfaces_incremental_compile_time": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_incremental_compile_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "fruit_startup_time_with_normalized_component": "Fruit" + "boost_di_startup_time_with_normalized_component": "Boost.DI" + "simple_di_startup_time_with_normalized_component": "Simple DI" + "simple_di_with_interfaces_startup_time_with_normalized_component": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_startup_time_with_normalized_component": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column results: - dimension: "compile_time" + dimension: "fruit_startup_time_with_normalized_component" unit: "seconds" - - name: "Compile memory (100 classes)" + - name: "Startup time with normalized component (GCC)" benchmark_filter: - num_classes: 100 + compiler: "g++-9" benchmark_generation_flags: [] additional_cmake_args: [] name: [ - "fruit_compile_memory", - "boost_di_compile_memory", - "simple_di_compile_memory", - "simple_di_with_interfaces_compile_memory", - "simple_di_with_interfaces_and_new_delete_compile_memory", + "fruit_startup_time_with_normalized_component", + "boost_di_startup_time_with_normalized_component", + "simple_di_startup_time_with_normalized_component", + "simple_di_with_interfaces_startup_time_with_normalized_component", + "simple_di_with_interfaces_and_new_delete_startup_time_with_normalized_component", ] - columns: + rows: dimension: "name" pretty_printer: fixed_map: - "fruit_compile_memory": "Fruit" - "boost_di_compile_memory": "Boost.DI" - "simple_di_incremental_compile_memory": "Simple DI" - "simple_di_with_interfaces_incremental_compile_memory": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_incremental_compile_memory": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "fruit_startup_time_with_normalized_component": "Fruit" + "boost_di_startup_time_with_normalized_component": "Boost.DI" + "simple_di_startup_time_with_normalized_component": "Simple DI" + "simple_di_with_interfaces_startup_time_with_normalized_component": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_startup_time_with_normalized_component": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column results: - dimension: "max_ram_usage" - unit: "bytes" + dimension: "fruit_startup_time_with_normalized_component" + unit: "seconds" - - name: "Fruit full injection time (100 classes)" + - name: "Component normalization time (Clang)" benchmark_filter: - num_classes: 100 + compiler: "clang++-10" benchmark_generation_flags: [] additional_cmake_args: [] - columns: + rows: dimension: "name" pretty_printer: fixed_map: @@ -197,17 +301,17 @@ tables: "simple_di_incremental_run_time": "Simple DI" "simple_di_with_interfaces_incremental_run_time": "Simple DI w/ interfaces" "simple_di_with_interfaces_and_new_delete_incremental_run_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + columns: *num_classes_column results: - dimension: "Full injection time" + dimension: "componentNormalizationTime" unit: "seconds" - - name: "Fruit component normalization time (100 classes)" + - name: "Component normalization time (GCC)" benchmark_filter: - num_classes: 100 + compiler: "g++-9" benchmark_generation_flags: [] additional_cmake_args: [] - columns: + rows: dimension: "name" pretty_printer: fixed_map: @@ -216,65 +320,427 @@ tables: "simple_di_incremental_run_time": "Simple DI" "simple_di_with_interfaces_incremental_run_time": "Simple DI w/ interfaces" "simple_di_with_interfaces_and_new_delete_incremental_run_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + columns: *num_classes_column results: dimension: "componentNormalizationTime" unit: "seconds" - - - name: "Setup time (100 classes)" + - name: "Per-request time (Clang)" benchmark_filter: - num_classes: 100 + compiler: "clang++-10" benchmark_generation_flags: [] additional_cmake_args: [] - columns: + rows: dimension: "name" pretty_printer: fixed_map: "fruit_run_time": "Fruit" "boost_di_run_time": "Boost.DI" - "simple_di_incremental_run_time": "Simple DI" - "simple_di_with_interfaces_incremental_run_time": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_incremental_run_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "simple_di_run_time": "Simple DI" + "simple_di_with_interfaces_run_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_run_time": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column results: - dimension: "Total for setup" + dimension: "Total per request" unit: "seconds" - - name: "Per-request time (100 classes)" + - name: "Per-request time (GCC)" benchmark_filter: - num_classes: 100 + compiler: "g++-9" benchmark_generation_flags: [] additional_cmake_args: [] - columns: + rows: dimension: "name" pretty_printer: fixed_map: "fruit_run_time": "Fruit" "boost_di_run_time": "Boost.DI" - "simple_di_incremental_run_time": "Simple DI" - "simple_di_with_interfaces_incremental_run_time": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_incremental_run_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "simple_di_run_time": "Simple DI" + "simple_di_with_interfaces_run_time": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_run_time": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column results: dimension: "Total per request" unit: "seconds" - - - name: "Executable size (stripped, 100 classes)" + + - name: "Executable size (stripped, Clang)" benchmark_filter: - num_classes: 100 + compiler: "clang++-10" benchmark_generation_flags: [] additional_cmake_args: [] - columns: + rows: dimension: "name" pretty_printer: fixed_map: "fruit_executable_size": "Fruit" "boost_di_executable_size": "Boost.DI" - "simple_di_incremental_run_time": "Simple DI" - "simple_di_with_interfaces_incremental_run_time": "Simple DI w/ interfaces" - "simple_di_with_interfaces_and_new_delete_incremental_run_time": "Simple DI w/ interfaces, new/delete" - rows: *compiler_name_row + "simple_di_executable_size": "Simple DI" + "simple_di_with_interfaces_executable_size": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_executable_size": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Executable size (stripped, GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + additional_cmake_args: [] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_executable_size": "Fruit" + "boost_di_executable_size": "Boost.DI" + "simple_di_executable_size": "Simple DI" + "simple_di_with_interfaces_executable_size": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_executable_size": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Executable size (stripped, no exceptions/RTTI, Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + additional_cmake_args: ['-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti'] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_executable_size_without_exceptions_and_rtti": "Fruit" + "boost_di_executable_size_without_exceptions_and_rtti": "Boost.DI" + "simple_di_executable_size_without_exceptions_and_rtti": "Simple DI" + "simple_di_with_interfaces_executable_size_without_exceptions_and_rtti": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_executable_size_without_exceptions_and_rtti": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Executable size (stripped, no exceptions/RTTI, GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + additional_cmake_args: ['-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti'] + rows: + dimension: "name" + pretty_printer: + fixed_map: + "fruit_executable_size_without_exceptions_and_rtti": "Fruit" + "boost_di_executable_size_without_exceptions_and_rtti": "Boost.DI" + "simple_di_executable_size_without_exceptions_and_rtti": "Simple DI" + "simple_di_with_interfaces_executable_size_without_exceptions_and_rtti": "Simple DI w/ interfaces" + "simple_di_with_interfaces_and_new_delete_executable_size_without_exceptions_and_rtti": "Simple DI w/ interfaces, new/delete" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + # Fruit: performance by default and with various compiler options. + + - name: "Fruit compile time (Clang)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "clang++-10" + name: "fruit_compile_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "compile_time" + unit: "seconds" + + - name: "Fruit compile time (GCC)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "g++-9" + name: "fruit_compile_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "compile_time" + unit: "seconds" + + - name: "Fruit incremental compile time (Clang)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "clang++-10" + name: "fruit_incremental_compile_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "incremental_compile_time" + unit: "seconds" + + - name: "Fruit incremental compile time (GCC)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "g++-9" + name: "fruit_incremental_compile_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "incremental_compile_time" + unit: "seconds" + + - name: "Fruit compile memory (Clang)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "clang++-10" + name: "fruit_compile_memory" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "max_ram_usage" + unit: "bytes" + + - name: "Fruit compile memory (GCC)" + benchmark_filter: + benchmark_generation_flags: [] + compiler: "g++-9" + name: "fruit_compile_memory" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "max_ram_usage" + unit: "bytes" + + - name: "Fruit startup time (Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + name: "fruit_startup_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "startup_time" + unit: "seconds" + + - name: "Fruit startup time (GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + name: "fruit_startup_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "startup_time" + unit: "seconds" + + - name: "Fruit startup time with normalized component (Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + name: "fruit_startup_time_with_normalized_component" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "startup_time" + unit: "seconds" + + - name: "Fruit startup time with normalized component (GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + name: "fruit_startup_time_with_normalized_component" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "startup_time" + unit: "seconds" + + - name: "Fruit component normalization time (Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "componentNormalizationTime" + unit: "seconds" + + - name: "Fruit component normalization time (GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "componentNormalizationTime" + unit: "seconds" + + - name: "Fruit per-request time (Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + name: "fruit_run_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "Total per request" + unit: "seconds" + + - name: "Fruit per-request time (GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + name: "fruit_run_time" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "Total per request" + unit: "seconds" + + - name: "Fruit executable size (stripped, Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + name: "fruit_executable_size" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Fruit executable size (stripped, GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + name: "fruit_executable_size" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple []: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False"]: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False"]: "without boost" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Fruit executable size (stripped, no exceptions/RTTI, Clang)" + benchmark_filter: + compiler: "clang++-10" + benchmark_generation_flags: [] + name: "fruit_executable_size_without_exceptions_and_rtti" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple ['-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False", '-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False", '-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "without boost" + columns: *num_classes_column + results: + dimension: "num_bytes" + unit: "bytes" + + - name: "Fruit executable size (stripped, no exceptions/RTTI, GCC)" + benchmark_filter: + compiler: "g++-9" + benchmark_generation_flags: [] + name: "fruit_executable_size_without_exceptions_and_rtti" + rows: + dimension: "additional_cmake_args" + pretty_printer: + fixed_map: + !!python/tuple ['-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "(defaults)" + !!python/tuple ["-DBUILD_SHARED_LIBS=False", '-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "statically linked" + !!python/tuple ["-DFRUIT_USES_BOOST=False", '-DCMAKE_CXX_FLAGS=-fno-exceptions -fno-rtti']: "without boost" + columns: *num_classes_column results: dimension: "num_bytes" unit: "bytes" diff --git a/extras/dockerfiles/Dockerfile.ubuntu-20.04 b/extras/dockerfiles/Dockerfile.ubuntu-20.04 new file mode 100644 index 0000000..bf8d5af --- /dev/null +++ b/extras/dockerfiles/Dockerfile.ubuntu-20.04 @@ -0,0 +1,9 @@ +FROM ubuntu:20.04 +MAINTAINER Marco Poletti <poletti.marco@gmail.com> + +COPY ubuntu-20.04_custom.list /etc/apt/sources.list.d/ +COPY common_install.sh common_cleanup.sh ubuntu-20.04_install.sh / + +RUN bash -x /common_install.sh && \ + bash -x /ubuntu-20.04_install.sh && \ + bash -x /common_cleanup.sh diff --git a/extras/dockerfiles/rebuild_all.sh b/extras/dockerfiles/rebuild_all.sh index f84dbbd..a0c6760 100755 --- a/extras/dockerfiles/rebuild_all.sh +++ b/extras/dockerfiles/rebuild_all.sh @@ -7,7 +7,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset COMMANDS=() -for V in 16.04 18.04 19.04 16.04 19.10 +for V in 16.04 18.04 19.04 16.04 19.10 20.04 do C="docker build -t polettimarco/fruit-basesystem:ubuntu-$V -f Dockerfile.ubuntu-$V ." COMMANDS+=("$C || { echo; echo FAILED: '$C'; echo; exit 1; }") diff --git a/extras/dockerfiles/ubuntu-20.04_custom.list b/extras/dockerfiles/ubuntu-20.04_custom.list new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/extras/dockerfiles/ubuntu-20.04_custom.list diff --git a/extras/dockerfiles/ubuntu-20.04_install.sh b/extras/dockerfiles/ubuntu-20.04_install.sh new file mode 100644 index 0000000..b671533 --- /dev/null +++ b/extras/dockerfiles/ubuntu-20.04_install.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +cat <<EOF >/etc/apt/sources.list.d/ubuntu-20.04_custom.list +# i386 not available +deb http://apt.llvm.org/focal/ llvm-toolchain-focal main +deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main +deb http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main +deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main +deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main +deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main +EOF + +apt-get update + +apt-get install -y --allow-unauthenticated --no-install-recommends \ + g++-7 \ + g++-8 \ + g++-9 \ + g++-10 \ + clang-6.0 \ + clang-7 \ + clang-8 \ + clang-9 \ + clang-10 \ + python \ + python3-sh \ + python3-typed-ast \ + clang-tidy \ + clang-format |