In case folks do not use eatmydata or tmpfs for testing,
use transactions to reduce the number of fsync calls
made and hopefully prevent drives from wearing out.
my $rw = PublicInbox::SearchIdx->new($git_dir, 1);
my $ro = PublicInbox::Search->new($git_dir);
+$rw = undef;
my $rw_commit = sub {
+ $rw->{xdb}->commit_transaction if $rw;
$rw = undef;
$rw = PublicInbox::SearchIdx->new($git_dir, 1);
+ $rw->{xdb}->begin_transaction;
};
{
body => "goodbye forever :<\n");
my $rv;
+ $rw_commit->();
$root_id = $rw->add_message($root);
is($root_id, int($root_id), "root_id is an integer: $root_id");
$last_id = $rw->add_message($last);