Home | History | Annotate | Download | only in src

Lines Matching refs:kBlockSize

104   template<int kBlockSize> static void BM_DefaultHash(int iterations,
106 RollingHash<kBlockSize> hasher;
115 template<int kBlockSize> static void BM_UpdateHash(int iterations,
117 RollingHash<kBlockSize> hasher;
124 buffer[i + kBlockSize]);
137 template<int kBlockSize> void UpdateHashMatchesHashForBlockSize() {
138 RollingHash<kBlockSize>::Init();
139 RollingHash<kBlockSize> hasher;
142 PortableRandomInRange(kUpdateHashBlocks - 1) + kBlockSize;
145 for (int i = kBlockSize; i < random_buffer_size; ++i) {
148 buffer_[i - kBlockSize],
152 EXPECT_EQ(running_hash, hasher.Hash(&buffer_[i + 1 - kBlockSize]));
157 template<int kBlockSize> double DefaultHashTimingTest() {
158 // Execution time is expected to be O(kBlockSize) per hash operation,
160 const int kTimingTestIterations = kTimingTestSize / kBlockSize;
163 BM_DefaultHash<kBlockSize>(kTimingTestIterations, buffer_);
169 template<int kBlockSize> double RollingTimingTest() {
175 BM_UpdateHash<kBlockSize>(kTimingTestIterations, buffer_);
189 template<int kBlockSize> void RunTimingTestForBlockSize() {
190 RollingHash<kBlockSize>::Init();
192 const double time_for_default_hash = DefaultHashTimingTest<kBlockSize>();
193 const double time_for_rolling_hash = RollingTimingTest<kBlockSize>();
195 kBlockSize,
201 if (kBlockSize > 16) {