MCPcopy Create free account
hub / github.com/ElementsProject/elements / Crc32c

Method Crc32c

src/leveldb/benchmarks/db_bench.cc:614–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 5

ValueFunction · 0.85
AddBytesMethod · 0.80
AddMessageMethod · 0.80
dataMethod · 0.45
FinishedSingleOpMethod · 0.45

Tested by

no test coverage detected