MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / uncompressedLogEntryIteration

Function uncompressedLogEntryIteration

runtime/Perf.cc:1161–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159
1160
1161double uncompressedLogEntryIteration() {
1162 int arraySize = 1000000;
1163
1164 typedef Log::UncompressedEntry Entry;
1165 Entry *in = static_cast<Entry*>(malloc(sizeof(Entry)*arraySize));
1166 uint64_t junk = 0;
1167
1168 uint64_t start = Cycles::rdtsc();
1169 for (int j = 0; j < arraySize; ++j) {
1170 junk += in[j].entrySize;
1171 junk += in[j].fmtId;
1172 junk += in[j].timestamp;
1173 }
1174 uint64_t stop = Cycles::rdtsc();
1175
1176 discard(&junk);
1177 free(in);
1178
1179 return Cycles::toSeconds(stop - start)/(arraySize);
1180}
1181
1182double uncompressedLogEntryIterationWithFence() {
1183 int arraySize = 1000000;

Callers

nothing calls this directly

Calls 2

rdtscFunction · 0.85
discardFunction · 0.70

Tested by

no test coverage detected