Commit 1fd9e62b authored by Rajat Goel's avatar Rajat Goel Committed by Jordan DeLong

Just trying out one more combination

Summary:
It seems it is not std::bind which is slow but the construction of
std::function from std::bind that is slow.

Test Plan: ran benchmarks

Reviewed By: delong.j@fb.com

FB internal diff: D581967
parent 32801ac2
......@@ -130,6 +130,15 @@ BENCHMARK(std_bind_create_invoke, iters) {
}
}
// Using std::bind directly to invoke a member function
BENCHMARK(std_bind_direct_invoke, iters) {
TestClass tc;
for (int n = 0; n < iters; ++n) {
auto fn = std::bind(&TestClass::doNothing, &tc);
fn();
}
}
// Using ScopeGuard to invoke a std::function
BENCHMARK(scope_guard_std_function, iters) {
std::function<void()> fn(doNothing);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment