Repository: kudu Updated Branches: refs/heads/master 3d3c6f033 -> f441b45bf
cfile-test: use a faster data generator for 100M-string test The current data generator using StringPrintf is not very fast, and since we don't care about the contents of the file for this test, it's just as easy to use FastHex64ToBuffer for better performance. This resulted in a ~2x speedup in the test. This means that the test will now better represent the underlying performance of the encoder and cfile writing code. Change-Id: I9578681aa2e064dbecd79fdce7b8a083ef03b3c4 Reviewed-on: http://gerrit.cloudera.org:8080/5201 Tested-by: Kudu Jenkins Reviewed-by: Dan Burkert <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/5de4837b Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5de4837b Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5de4837b Branch: refs/heads/master Commit: 5de4837b3eb666f0cf4f56903e9e449666e5be34 Parents: 3d3c6f0 Author: Todd Lipcon <[email protected]> Authored: Wed Nov 23 08:48:24 2016 -0800 Committer: Todd Lipcon <[email protected]> Committed: Wed Nov 30 01:31:32 2016 +0000 ---------------------------------------------------------------------- src/kudu/cfile/cfile-test.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/5de4837b/src/kudu/cfile/cfile-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/cfile/cfile-test.cc b/src/kudu/cfile/cfile-test.cc index 0cb121c..4514c54 100644 --- a/src/kudu/cfile/cfile-test.cc +++ b/src/kudu/cfile/cfile-test.cc @@ -271,7 +271,11 @@ class TestCFile : public CFileTestBase { BlockId block_id; LOG_TIMING(INFO, "writing 100M strings") { LOG(INFO) << "Starting writefile"; - StringDataGenerator<false> generator("hello %zu"); + StringDataGenerator<false> generator([](size_t idx) { + char buf[kFastToBufferSize]; + FastHex64ToBuffer(idx, buf); + return string(buf); + }); WriteTestFile(&generator, encoding, NO_COMPRESSION, 100000000, NO_FLAGS, &block_id); LOG(INFO) << "Done writing"; }
