diff options
author | Eric Wong <e@80x24.org> | 2021-01-03 20:58:29 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-04 04:02:54 +0000 |
commit | 7c73a09c6df674e389fb20fb57f63c6bb9695d31 (patch) | |
tree | ea0fa44e55b063b58aa98bccac9bca6662d7e80e /t | |
parent | ddb34f3e901c2e93e9b02dbac31961225b33379f (diff) | |
download | public-inbox-7c73a09c6df674e389fb20fb57f63c6bb9695d31.tar.gz |
While our recv_3fds() implementation is more efficient syscall-wise, loading Inline takes nearly 50ms on my machine even after Inline::C memoizes the build. The current ~20ms in the fast path is barely acceptable to me, and 50ms would be unusable. Eventually, script/lei may invoke tcc(1) or cc(1) directly in the fast path, but it needs @INC for the slow path, at least. We'll encode the number of FDs into the socket name allow parallel installations, for now.
Diffstat (limited to 't')
-rw-r--r-- | t/lei.t | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -193,12 +193,14 @@ if ($ENV{TEST_LEI_ONESHOT}) { SKIP: { # real socket require_mods(qw(Cwd), my $nr = 46); - require PublicInbox::Spawn; - skip "Inline::C not installed/configured or IO::FDPass missing", $nr - unless PublicInbox::Spawn->can('send_3fds'); + my $nfd = eval { require IO::FDPass; 1 } // do { + require PublicInbox::Spawn; + PublicInbox::Spawn->can('send_3fds') ? 3 : undef; + } // + skip 'IO::FDPass missing or Inline::C not installed/configured', $nr; local $ENV{XDG_RUNTIME_DIR} = "$home/xdg_run"; - my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/sock"; + my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/$nfd.sock"; ok($lei->('daemon-pid'), 'daemon-pid'); is($err, '', 'no error from daemon-pid'); |