MCPcopy Create free account
hub / github.com/ByConity/ByConity / loop

Function loop

src/IO/examples/read_float_perf.cpp:42–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <typename T, void F(T&, ReadBuffer&)>
42void NO_INLINE loop(ReadBuffer & in, WriteBuffer & out)
43{
44 T sum = 0;
45 T x = 0;
46
47 Stopwatch watch;
48
49 while (!in.eof())
50 {
51 F(x, in);
52 in.ignore();
53 sum += x;
54 }
55
56 watch.stop();
57 out << "Read in " << watch.elapsedSeconds() << " sec, "
58 << formatReadableSizeWithBinarySuffix(in.count() / watch.elapsedSeconds()) << "/sec, result = " << sum << "\n";
59}
60
61
62int main(int argc, char ** argv)

Callers 1

threadMethod · 0.50

Calls 6

eofMethod · 0.45
ignoreMethod · 0.45
stopMethod · 0.45
elapsedSecondsMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected