diff --git a/core-buffer/test/test_bitshuffle.cpp b/core-buffer/test/test_bitshuffle.cpp index 5a44de9..a030256 100644 --- a/core-buffer/test/test_bitshuffle.cpp +++ b/core-buffer/test/test_bitshuffle.cpp @@ -1,3 +1,4 @@ +#include #include "gtest/gtest.h" #include "buffer_config.hpp" @@ -104,4 +105,39 @@ TEST(bitshuffle, separate_compression) ASSERT_EQ(out_frame_buffer[i], (i_adj%100) + 100); } } +} + +using namespace std; +using namespace chrono; + +TEST(bitshuffle, compression_speed) +{ + const int n_iterations = 100; + const size_t n_pixels = MODULE_N_PIXELS*32; + + auto frame_buffer = make_unique(n_pixels); + for (size_t i=0; i( + bshuf_compress_lz4_bound(n_pixels, PIXEL_N_BYTES, 0)); + + auto start_time = steady_clock::now(); + + for (int i=0; i( + end_time-start_time).count(); + + cout << endl << "Duration of " << duration/100 << " microseconds" << endl; } \ No newline at end of file