From 52cd1dd47c83f18681bab081db5041f8bfa5dfbe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Nov 2023 09:35:27 +0000 Subject: ds: replace FD map hash table with array FDs are array indices into the kernel, anyways, so we can take advantage of space savings and speedups because the majority of FDs a big process has is going to end up in the array, anyways. --- lib/PublicInbox/LeiStoreErr.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiStoreErr.pm') diff --git a/lib/PublicInbox/LeiStoreErr.pm b/lib/PublicInbox/LeiStoreErr.pm index fe4af51e..c8bc72b6 100644 --- a/lib/PublicInbox/LeiStoreErr.pm +++ b/lib/PublicInbox/LeiStoreErr.pm @@ -47,7 +47,7 @@ sub event_step { return ($!{EAGAIN} ? 0 : $self->close) if !defined($n); return $self->close if !$n; my $printed; - for my $lei (values %PublicInbox::DS::DescriptorMap) { + for my $lei (grep defined, @PublicInbox::DS::FD_MAP) { my $cb = $lei->can('store_path') // next; next if $cb->($lei) ne $self->{store_path}; emit($lei->{2} // next, $buf) and $printed = 1; -- cgit v1.2.3-24-ge0c7