mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Emulate mako.c's commit behavior during populate()
This commit is contained in:
parent
3205fe8ca4
commit
6224ea834b
@ -184,7 +184,7 @@ int populate(Transaction tx,
|
|||||||
stats.incrOpCount(OP_INSERT);
|
stats.incrOpCount(OP_INSERT);
|
||||||
|
|
||||||
/* commit every 100 inserts (default) or if this is the last key */
|
/* commit every 100 inserts (default) or if this is the last key */
|
||||||
if (i == key_end || (i - key_begin + 1) % num_commit_every == 0) {
|
if ((i % num_commit_every == 0) || i == key_end) {
|
||||||
const auto do_sample = (stats.getOpCount(OP_TRANSACTION) % args.sampling) == 0;
|
const auto do_sample = (stats.getOpCount(OP_TRANSACTION) % args.sampling) == 0;
|
||||||
auto watch_commit = Stopwatch(StartAtCtor{});
|
auto watch_commit = Stopwatch(StartAtCtor{});
|
||||||
auto future_commit = tx.commit();
|
auto future_commit = tx.commit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user