From e364a479ae075c0f5ae0a38e864a02cea0894b85 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 20 Jul 2017 17:24:03 -0400 Subject: [PATCH] unittest_compression: speed it up ~4m -> ~25s Signed-off-by: Sage Weil --- src/test/compressor/test_compression.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/compressor/test_compression.cc b/src/test/compressor/test_compression.cc index 55ca520aabb..179d1acbf54 100644 --- a/src/test/compressor/test_compression.cc +++ b/src/test/compressor/test_compression.cc @@ -106,7 +106,7 @@ TEST_P(CompressorTest, big_round_trip_repeated) TEST_P(CompressorTest, big_round_trip_randomish) { - unsigned len = 1048576 * 100;//269; + unsigned len = 1048576 * 10;//269; bufferlist orig; const char *alphabet = "abcdefghijklmnopqrstuvwxyz"; if (false) { @@ -243,7 +243,7 @@ void test_compress(CompressorRef compressor, size_t size) } bufferlist in; in.append(data, size); - for (size_t t = 0; t < 100000; t++) { + for (size_t t = 0; t < 10000; t++) { bufferlist out; int res = compressor->compress(in, out); EXPECT_EQ(res, 0); @@ -260,7 +260,7 @@ void test_decompress(CompressorRef compressor, size_t size) in.append(data, size); int res = compressor->compress(in, out); EXPECT_EQ(res, 0); - for (size_t t = 0; t < 100000; t++) { + for (size_t t = 0; t < 10000; t++) { bufferlist out_dec; int res = compressor->decompress(out, out_dec); EXPECT_EQ(res, 0); @@ -413,7 +413,7 @@ TEST(ZlibCompressor, isal_compress_zlib_decompress_random) g_ceph_context->_conf->apply_changes(NULL); CompressorRef zlib = Compressor::create(g_ceph_context, "zlib"); - for (int cnt=0; cnt<1000; cnt++) + for (int cnt=0; cnt<100; cnt++) { srand(cnt + 1000); int log2 = (rand()%18) + 1; @@ -449,7 +449,7 @@ TEST(ZlibCompressor, isal_compress_zlib_decompress_walk) g_ceph_context->_conf->apply_changes(NULL); CompressorRef zlib = Compressor::create(g_ceph_context, "zlib"); - for (int cnt=0; cnt<1000; cnt++) + for (int cnt=0; cnt<100; cnt++) { srand(cnt + 1000); int log2 = (rand()%18) + 1;