aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Poletti <poletti.marco@gmail.com>2018-09-11 00:20:36 +0100
committerMarco Poletti <poletti.marco@gmail.com>2018-09-11 00:20:36 +0100
commit8be18c186b074548bd94ce9072872a3aba807455 (patch)
tree6b9e0eeccebcd281f7f18929e3fbce479ed70b67
parentf061517566d885376873d7acc35233cc998da5a5 (diff)
downloadgoogle-fruit-8be18c186b074548bd94ce9072872a3aba807455.tar.gz
Remove the componentNormalizationTime benchs, the new startup benchs are more representative of real-world scenarios.
-rw-r--r--extras/benchmark/fruit_source_generator.py11
-rw-r--r--extras/benchmark/no_di_library_source_generator.py2
2 files changed, 1 insertions, 12 deletions
diff --git a/extras/benchmark/fruit_source_generator.py b/extras/benchmark/fruit_source_generator.py
index d7e2998..894bd28 100644
--- a/extras/benchmark/fruit_source_generator.py
+++ b/extras/benchmark/fruit_source_generator.py
@@ -119,16 +119,9 @@ int main(int argc, char* argv[]) {{
}}
size_t num_loops = std::atoi(argv[1]);
- std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now();
- for (size_t i = 0; i < 1 + num_loops/100; i++) {{
- fruit::NormalizedComponent<Interface{toplevel_component}> normalizedComponent(getComponent{toplevel_component});
- (void)normalizedComponent;
- }}
- double componentNormalizationTime = std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start_time).count();
-
fruit::NormalizedComponent<Interface{toplevel_component}> normalizedComponent(getComponent{toplevel_component});
- start_time = std::chrono::high_resolution_clock::now();
+ std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now();
for (size_t i = 0; i < num_loops; i++) {{
fruit::Injector<Interface{toplevel_component}> injector(normalizedComponent, getEmptyComponent);
injector.get<std::shared_ptr<Interface{toplevel_component}>>();
@@ -137,8 +130,6 @@ int main(int argc, char* argv[]) {{
std::cout << std::fixed;
std::cout << std::setprecision(15);
- std::cout << "componentNormalizationTime = " << componentNormalizationTime * 100 / num_loops << std::endl;
- std::cout << "Total for setup = " << componentNormalizationTime * 100 / num_loops << std::endl;
std::cout << "Total per request = " << perRequestTime / num_loops << std::endl;
return 0;
}}
diff --git a/extras/benchmark/no_di_library_source_generator.py b/extras/benchmark/no_di_library_source_generator.py
index 8b6d423..6b66aa9 100644
--- a/extras/benchmark/no_di_library_source_generator.py
+++ b/extras/benchmark/no_di_library_source_generator.py
@@ -206,8 +206,6 @@ int main(int argc, char* argv[]) {{
std::cout << std::fixed;
std::cout << std::setprecision(15);
- std::cout << "componentNormalizationTime = " << 0 << std::endl;
- std::cout << "Total for setup = " << 0 << std::endl;
std::cout << "Total per request = " << fullInjectionTime * 100 / num_loops << std::endl;
return 0;
}}