MCPcopy Create free account
hub / github.com/ceph/ceph / bench_buffer_alloc

Function bench_buffer_alloc

src/test/bufferlist.cc:130–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void bench_buffer_alloc(int size, int num)
131{
132 utime_t start = ceph_clock_now();
133 for (int i=0; i<num; ++i) {
134 bufferptr p = buffer::create(size);
135 p.zero();
136 }
137 utime_t end = ceph_clock_now();
138 cout << num << " alloc of size " << size
139 << " in " << (end - start) << std::endl;
140}
141
142TEST(Buffer, BenchAlloc) {
143 bench_buffer_alloc(16384, 1000000);

Callers 1

TESTFunction · 0.85

Calls 3

ceph_clock_nowFunction · 0.85
createFunction · 0.50
zeroMethod · 0.45

Tested by

no test coverage detected