diff options
author | Marco Poletti <poletti.marco@gmail.com> | 2014-10-19 23:58:03 -0700 |
---|---|---|
committer | Marco Poletti <poletti.marco@gmail.com> | 2014-10-19 23:58:03 -0700 |
commit | f50f56fd4b6732be6bcff10f93dcae31cabca98a (patch) | |
tree | 22ba8517eb5ef171f9438521080cf774672f2f68 /examples | |
parent | b1d265cc7ef85a251990fc3efa23ef9fc42f939d (diff) | |
download | google-fruit-f50f56fd4b6732be6bcff10f93dcae31cabca98a.tar.gz |
Another attempt to increase performance by having static storage in the injector.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/benchmark/generate_benchmark.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/benchmark/generate_benchmark.cpp b/examples/benchmark/generate_benchmark.cpp index f84d18d..5e86a61 100644 --- a/examples/benchmark/generate_benchmark.cpp +++ b/examples/benchmark/generate_benchmark.cpp @@ -229,7 +229,8 @@ int main(int argc, char* argv[]) { // mainFile << "injectorCreationTime += 1000000*std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start_time).count();" << endl; // mainFile << "start_time = std::chrono::high_resolution_clock::now();" << endl; for (int i = 0; i < num_types_per_component; ++i) { - mainFile << "injector.get<Interface" << toplevel_component << "_" << i << "*>();" << endl; + mainFile << "Interface" << toplevel_component << "_" << i << "* interface = injector.get<Interface" << toplevel_component << "_" << i << "*>();" << endl; + mainFile << "(void) interface;" << endl; } // mainFile << "injectionTime += 1000000*std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start_time).count();" << endl; // mainFile << "start_time = std::chrono::high_resolution_clock::now();" << endl; |