MCPcopy Create free account
hub / github.com/apple/foundationdb / doDeltaWriteBench

Function doDeltaWriteBench

fdbclient/BlobGranuleFiles.cpp:2865–2885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2863}
2864
2865std::pair<int64_t, double> doDeltaWriteBench(const Standalone<GranuleDeltas>& data,
2866 const KeyRangeRef& fileRange,
2867 bool chunked,
2868 Optional<BlobGranuleCipherKeysCtx> cipherKeys,
2869 Optional<CompressionFilter> compressionFilter) {
2870 Standalone<StringRef> fileNameRef = StringRef();
2871 int64_t serializedBytes = 0;
2872 double elapsed = -timer_monotonic();
2873 for (int runI = 0; runI < WRITE_RUNS; runI++) {
2874 if (!chunked) {
2875 serializedBytes = ObjectWriter::toValue(data, Unversioned()).size();
2876 } else {
2877 serializedBytes =
2878 serializeChunkedDeltaFile(fileNameRef, data, fileRange, 32 * 1024, compressionFilter, cipherKeys)
2879 .size();
2880 }
2881 }
2882 elapsed += timer_monotonic();
2883 elapsed /= WRITE_RUNS;
2884 return { serializedBytes, elapsed };
2885}
2886
2887FileSet rewriteChunkedFileSet(const FileSet& fileSet,
2888 Optional<BlobGranuleCipherKeysCtx> keys,

Callers 1

Calls 5

timer_monotonicFunction · 0.85
UnversionedFunction · 0.85
StringRefClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected