]> Sergey Matveev's repositories - public-inbox.git/commit
lei: micro-optimize startup time
authorEric Wong <e@80x24.org>
Thu, 17 Dec 2020 06:54:41 +0000 (06:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 19 Dec 2020 09:32:08 +0000 (09:32 +0000)
commit50ce71e698e038e643d81d9f5948e002384b5898
treed69320e3a8c2165e7d135e1ae24a6a57d27cf8e6
parent193e86164403dc0d43e7dc44ee68272897727f81
lei: micro-optimize startup time

We'll use lower-level Socket and avoid IO::Socket::UNIX,
use Cwd::fastcwd(*), avoid IO::Handle->autoflush by
using the select operator, and reuse buffer for reading
the socket while avoiding unnecessary $/ localization
in a tiny script.

All these things adds up to ~5-10 ms savings on my loaded
system.

(*) caveats about fastcwd won't apply since lei won't work
    in removed directories.
lib/PublicInbox/LEI.pm
lib/PublicInbox/TestCommon.pm
script/lei