| 612 | } |
| 613 | |
| 614 | void Crc32c(ThreadState* thread) { |
| 615 | // Checksum about 500MB of data total |
| 616 | const int size = 4096; |
| 617 | const char* label = "(4K per op)"; |
| 618 | std::string data(size, 'x'); |
| 619 | int64_t bytes = 0; |
| 620 | uint32_t crc = 0; |
| 621 | while (bytes < 500 * 1048576) { |
| 622 | crc = crc32c::Value(data.data(), size); |
| 623 | thread->stats.FinishedSingleOp(); |
| 624 | bytes += size; |
| 625 | } |
| 626 | // Print so result is not dead |
| 627 | fprintf(stderr, "... crc=0x%x\r", static_cast<unsigned int>(crc)); |
| 628 | |
| 629 | thread->stats.AddBytes(bytes); |
| 630 | thread->stats.AddMessage(label); |
| 631 | } |
| 632 | |
| 633 | void SnappyCompress(ThreadState* thread) { |
| 634 | RandomGenerator gen; |
nothing calls this directly
no test coverage detected