diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a57838..32837a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,18 +28,12 @@ jobs: build_configuration: 'Release' - job_name: 'x64 (MSVC): Windows (VS 2022, debug)' build_configuration: 'Debug' - # TODO: Resolve the issue and re-enable benchmark. - # See: https://github.com/bitcoin-core/minisketch/pull/96. - skip_benchmark: true - job_name: 'x64 (MSVC): Windows (VS 2022, shared)' cmake_options: '-DBUILD_SHARED_LIBS=ON' build_configuration: 'Release' - job_name: 'x64 (clang-cl): Windows (VS 2022)' cmake_options: '-T ClangCL' build_configuration: 'Release' - # TODO: Resolve the issue and re-enable benchmark. - # See: https://github.com/bitcoin-core/minisketch/pull/96. - skip_benchmark: true steps: - name: Checkout @@ -64,6 +58,5 @@ jobs: run: ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C ${{ matrix.configuration.build_configuration }} - name: Benchmark - if: ${{ ! matrix.configuration.skip_benchmark }} working-directory: build run: bin\${{ matrix.configuration.build_configuration }}\bench.exe diff --git a/src/bench.cpp b/src/bench.cpp index dc44379..ac7fb03 100644 --- a/src/bench.cpp +++ b/src/bench.cpp @@ -6,6 +6,7 @@ #include "../include/minisketch.h" #include +#include #include #include #include @@ -42,7 +43,13 @@ int main(int argc, char** argv) { std::vector states; std::vector roots(2 * syndromes); std::random_device rng; - std::uniform_int_distribution dist(1, (uint64_t(1) << bits) - 1); + uint64_t upper_bound; + if (bits < 64) { + upper_bound = (uint64_t(1) << bits) - 1; + } else { + upper_bound = std::numeric_limits::max(); + } + std::uniform_int_distribution dist(1, upper_bound); states.resize(iters); std::vector benches; benches.reserve(iters);