From 9b0c238f887475d920a8589b492ec15c63770152 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Jul 2022 04:41:54 +0000 Subject: nntp: resolve inboxes immediately on group listings This prevents potential races between SIGHUP config reloads while gigantic group listings are streaming, allowing us to avoid many invalidation checks. This also reduces send(2) syscalls and avoid Perl internal pad allocations in a few places where it's not beneficial. There might be a slight (0.5%) speedup, but I'm not sure if that's down to system noise, power/thermal management, or other users on my VM. --- lib/PublicInbox/NNTPD.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/NNTPD.pm') diff --git a/lib/PublicInbox/NNTPD.pm b/lib/PublicInbox/NNTPD.pm index 0350830b..6e79f0be 100644 --- a/lib/PublicInbox/NNTPD.pm +++ b/lib/PublicInbox/NNTPD.pm @@ -55,7 +55,7 @@ sub refresh_groups { # run in the same process someday. } }); - $self->{groupnames} = [ sort(keys %$groups) ]; + @{$self->{groupnames}} = sort(keys %$groups); # this will destroy old groups that got deleted $self->{pi_cfg} = $pi_cfg; } -- cgit v1.2.3-24-ge0c7