|
1 | 1 | #pragma once
|
2 | 2 |
|
| 3 | +#include <bind/blob.hpp> |
3 | 4 | #include <bind/yaclib/intrusive_list.hpp>
|
4 | 5 | #include <yaclib/algo/when_all.hpp>
|
5 | 6 | #include <yaclib/algo/when_any.hpp>
|
@@ -106,35 +107,19 @@ struct YACLib {
|
106 | 107 | static void Contention(benchmark::State& state);
|
107 | 108 | };
|
108 | 109 |
|
109 |
| -template <typename T> |
110 |
| -void YACLib::ComplexBenchmark() { |
111 |
| - auto fs = detail::yb::FsGen<T>(); |
112 |
| - (void)WhenAll(fs.begin(), fs.end()).Get().Ok(); |
113 |
| - fs = detail::yb::FsGen<T>(); |
114 |
| - (void)WhenAny(fs.begin(), fs.end()).Get().Ok(); |
115 |
| - fs = detail::yb::FsGen<T>(); |
116 |
| - for (auto& f : fs) { |
117 |
| - if constexpr (std::is_void_v<T>) { |
118 |
| - f = std::move(f).ThenInline([] { |
119 |
| - }); |
120 |
| - } else { |
121 |
| - f = std::move(f).ThenInline([](T&& t) { |
122 |
| - return std::move(t); |
123 |
| - }); |
124 |
| - } |
125 |
| - } |
126 |
| - fs = detail::yb::FsGen<T>(); |
127 |
| - for (auto& f : fs) { |
128 |
| - if constexpr (std::is_void_v<T>) { |
129 |
| - f = std::move(f).ThenInline([](yaclib::Result<T>&& /*TODO(MBkkt) remove this*/) { |
130 |
| - return yaclib::MakeFuture(); |
131 |
| - }); |
132 |
| - } else { |
133 |
| - f = std::move(f).ThenInline([](T&& t) { |
134 |
| - return yaclib::MakeFuture(std::move(t)); |
135 |
| - }); |
136 |
| - } |
137 |
| - } |
138 |
| -} |
| 110 | +extern template void YACLib::ComplexBenchmark<void>(); |
| 111 | +extern template void YACLib::ComplexBenchmark<Blob<2>>(); |
| 112 | +extern template void YACLib::ComplexBenchmark<Blob<4>>(); |
| 113 | +extern template void YACLib::ComplexBenchmark<Blob<8>>(); |
| 114 | +extern template void YACLib::ComplexBenchmark<Blob<16>>(); |
| 115 | +extern template void YACLib::ComplexBenchmark<Blob<32>>(); |
| 116 | +extern template void YACLib::ComplexBenchmark<Blob<64>>(); |
| 117 | +extern template void YACLib::ComplexBenchmark<Blob<128>>(); |
| 118 | +extern template void YACLib::ComplexBenchmark<Blob<256>>(); |
| 119 | +extern template void YACLib::ComplexBenchmark<Blob<512>>(); |
| 120 | +extern template void YACLib::ComplexBenchmark<Blob<1024>>(); |
| 121 | +extern template void YACLib::ComplexBenchmark<Blob<2048>>(); |
| 122 | +extern template void YACLib::ComplexBenchmark<Blob<4096>>(); |
| 123 | +extern template void YACLib::ComplexBenchmark<Blob<8192>>(); |
139 | 124 |
|
140 | 125 | } // namespace bench
|
0 commit comments