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

Function bench_bufferlist_alloc

src/test/bufferlist.cc:1345–1356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1343}
1344
1345void bench_bufferlist_alloc(int size, int num, int per)
1346{
1347 utime_t start = ceph_clock_now();
1348 for (int i=0; i<num; ++i) {
1349 bufferlist bl;
1350 for (int j=0; j<per; ++j)
1351 bl.push_back(buffer::ptr_node::create(buffer::create(size)));
1352 }
1353 utime_t end = ceph_clock_now();
1354 cout << num << " alloc of size " << size
1355 << " in " << (end - start) << std::endl;
1356}
1357
1358TEST(BufferList, BenchAlloc) {
1359 bench_bufferlist_alloc(32768, 100000, 16);

Callers 1

TESTFunction · 0.85

Calls 3

ceph_clock_nowFunction · 0.85
createFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected