mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 16:40:35 +00:00
This is an attempt (mostly suggested and implemented by AI, but with a few hours of human babysitting...), to somewhat reduce compilation time by picking one template, named_value<T>, which is used in more than a hundred source files through the config.hh header, and making it use external instantiation: The different methods of named_value<T> for various T are instantiated only once (in config.cc), and the individual translation units don't need to compile them a hundred times. The resulting saving is a little underwhelming: The total object-file size goes down about 1% (from 346,200 before the patch to 343,488 after the patch), and previous experience shows that this object-file size is proportional to the compilation time, most of which involves code generation. But I haven't been able to measure speedup of the build itself. 1% is not nothing, but not a huge saving either. Though arguably, with 50 more of these patches, we can make the build twice faster :-) Refs #1. Closes scylladb/scylladb#28992 * github.com:scylladb/scylladb: config: move named_value<T> method bodies out-of-line config: suppress named_value<T> instantiation in every source file
37 lines
950 B
C++
37 lines
950 B
C++
/*
|
|
* Copyright (C) 2018 ScyllaDB
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "utils/config_file.hh"
|
|
|
|
namespace encryption {
|
|
|
|
class encryption_config : public utils::config_file {
|
|
public:
|
|
encryption_config();
|
|
|
|
typedef std::unordered_map<sstring, string_map> string_string_map;
|
|
|
|
named_value<sstring> system_key_directory;
|
|
named_value<bool> config_encryption_active;
|
|
named_value<sstring> config_encryption_key_name;
|
|
named_value<string_map> system_info_encryption;
|
|
named_value<string_string_map> kmip_hosts;
|
|
named_value<string_string_map> kms_hosts;
|
|
named_value<string_string_map> gcp_hosts;
|
|
named_value<string_string_map> azure_hosts;
|
|
named_value<string_map> user_info_encryption;
|
|
named_value<bool> allow_per_table_encryption;
|
|
};
|
|
|
|
}
|
|
|
|
extern template struct utils::config_file::named_value<encryption::encryption_config::string_string_map>;
|