diff options
| author | levlam <levlam@telegram.org> | 2020-06-11 01:49:20 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2020-06-11 01:49:20 +0300 |
| commit | 8e7c6fcda27414b4d33369db4600bac8b6035458 (patch) | |
| tree | f7d3f94725793e49821bc9a0270b7d8898bd944f /benchmark/bench_crypto.cpp | |
| parent | a726450e0b6c94fc2782f482fc39092a28450e5c (diff) | |
Fix OpenSSL initialization.
GitOrigin-RevId: 83eb7addf7d0407432fc8d4ba1a4cb6464818cc7
Diffstat (limited to 'benchmark/bench_crypto.cpp')
| -rw-r--r-- | benchmark/bench_crypto.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/benchmark/bench_crypto.cpp b/benchmark/bench_crypto.cpp index 394930258..3cab9a8c4 100644 --- a/benchmark/bench_crypto.cpp +++ b/benchmark/bench_crypto.cpp @@ -112,13 +112,13 @@ BENCH(SslRand, "ssl_rand_int32") { std::vector<td::thread> v; std::atomic<td::uint32> sum{0}; for (int i = 0; i < 3; i++) { - v.push_back(td::thread([&] { + v.emplace_back([&sum, n] { td::int32 res = 0; for (int j = 0; j < n; j++) { res ^= td::Random::secure_int32(); } sum += res; - })); + }); } for (auto &x : v) { x.join(); @@ -196,6 +196,8 @@ class Crc64Bench : public td::Benchmark { }; int main() { + td::init_openssl_threads(); + td::bench(Pbkdf2Bench()); td::bench(RandBench()); td::bench(CppRandBench()); |
