dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] daemon: experimental PREALLOC_NR env knob
@ 2024-02-01 10:01 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-02-01 10:01 UTC (permalink / raw)
  To: spew

---
 lib/PublicInbox/Daemon.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index a2c1ed6e..20755dce 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -36,6 +36,15 @@ my %SCHEME2PORT = map { $KNOWN_TLS{$_} => $_ + 0 } keys %KNOWN_TLS;
 for (keys %KNOWN_STARTTLS) { $SCHEME2PORT{$KNOWN_STARTTLS{$_}} = $_ + 0 }
 $SCHEME2PORT{http} = 80;
 
+BEGIN {
+	if (my $nr = $ENV{PREALLOC_NR}) {
+		my @tmp = map {
+			my $ary = [];
+			{ "$ary" => $ary };
+		} (0..$nr);
+	}
+}
+
 our ($parent_pipe, %POST_ACCEPT, %XNETD);
 our %WORKER_SIG = (
 	INT => \&worker_quit,

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

only message in thread, other threads:[~2024-02-01 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 10:01 [PATCH] daemon: experimental PREALLOC_NR env knob 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).