aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarco Poletti <poletti.marco@gmail.com>2014-11-09 11:16:51 +0000
committerMarco Poletti <poletti.marco@gmail.com>2014-11-09 11:16:51 +0000
commit3396ad9cdbb0f1f997cb5d9ffa5bd6b0f76cd48a (patch)
tree662ea2dfec9f4d6ffd10b4d25e827ffbbe8aa84d /examples
parenta1e9958be71409f7aaafca7c051a88e9210df74e (diff)
downloadgoogle-fruit-3396ad9cdbb0f1f997cb5d9ffa5bd6b0f76cd48a.tar.gz
Update the benchmark to avoid copying NormalizedComponents (it's no longer allowed).
Diffstat (limited to 'examples')
-rw-r--r--examples/benchmark/generate_benchmark.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/examples/benchmark/generate_benchmark.cpp b/examples/benchmark/generate_benchmark.cpp
index f84d18d..67c8be9 100644
--- a/examples/benchmark/generate_benchmark.cpp
+++ b/examples/benchmark/generate_benchmark.cpp
@@ -218,14 +218,10 @@ int main(int argc, char* argv[]) {
mainFile << "start_time = std::chrono::high_resolution_clock::now();" << endl;
mainFile << "for (size_t i = 0; i < num_loops; i++) {" << endl;
mainFile << "{" << endl;
- mainFile << "fruit::NormalizedComponent";
- printComponentArgs(toplevel_component, mainFile);
- mainFile << " normalizedComponentCopy = normalizedComponent;" << endl;
- // mainFile << "componentCopyTime += 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;
mainFile << "fruit::Injector";
printComponentArgs(toplevel_component, mainFile);
- mainFile << " injector(std::move(normalizedComponentCopy), fruit::createComponent());" << endl;
+ mainFile << " injector(normalizedComponent, fruit::createComponent());" << endl;
// 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) {
@@ -244,7 +240,6 @@ int main(int argc, char* argv[]) {
mainFile << "std::cout << \"componentCreationTime = \" << componentCreationTime * 50 / num_loops << std::endl;" << endl;
mainFile << "std::cout << \"componentNormalizationTime = \" << componentNormalizationTime * 50 / num_loops << std::endl;" << endl;
mainFile << "std::cout << \"Total for setup = \" << (componentCreationTime + componentNormalizationTime) * 50 / num_loops << std::endl;" << endl;
- //mainFile << "std::cout << \"componentCopyTime = \" << componentCopyTime / num_loops << std::endl;" << endl;
//mainFile << "std::cout << \"injectorCreationTime = \" << injectorCreationTime / num_loops << std::endl;" << endl;
//mainFile << "std::cout << \"injectionTime = \" << injectionTime / num_loops << std::endl;" << endl;
//mainFile << "std::cout << \"destructionTime = \" << destructionTime / num_loops << std::endl;" << endl;