unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] v2writable: disable parallelism on indexlevel=basic
@ 2019-01-01 11:50 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-01-01 11:50 UTC (permalink / raw)
  To: meta

There is no need for parallelism if we're not using Xapian.
---
 lib/PublicInbox/V2Writable.pm | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 152d90a..0731964 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -223,11 +223,16 @@ sub idx_init {
 	# frequently activated.
 	delete $ibx->{$_} foreach (qw(git mm search));
 
-       if ($self->{parallel}) {
-               pipe(my ($r, $w)) or die "pipe failed: $!";
-               $self->{bnote} = [ $r, $w ];
-               $w->autoflush(1);
-       }
+	my $indexlevel = $ibx->{indexlevel};
+	if ($indexlevel && $indexlevel eq 'basic') {
+		$self->{parallel} = 0;
+	}
+
+	if ($self->{parallel}) {
+		pipe(my ($r, $w)) or die "pipe failed: $!";
+		$self->{bnote} = [ $r, $w ];
+		$w->autoflush(1);
+	}
 
 	my $over = $self->{over};
 	$ibx->umask_prepare;
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-01 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-01 11:50 [PATCH] v2writable: disable parallelism on indexlevel=basic Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).