about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-23 08:38:52 +0000
committerEric Wong <e@80x24.org>2020-12-23 23:46:44 +0000
commita05445fb400108e60ede7d377cf3b26a0392eb24 (patch)
tree6e21bab9bb8155cf9b764e8c5c91754e94be28bd /script
parent80424a6a72dbe2b1ea7ba9bfba8f273e4da385a7 (diff)
downloadpublic-inbox-a05445fb400108e60ede7d377cf3b26a0392eb24.tar.gz
We can avoid a slow regexp capture and instead and rely on
rindex + substr to extract the section from the config file.

Then we use the defined-or-assignment (//=) operator combined
with the documented return value of `push' to ensure @section_order
is unique without repeating a hash lookup.

Finally, we avoid short-lived variables inside the loop and
declare them subroutine-wide to knock a teeny bit of allocation
time.

Combined, these optimizations bring the ~1.22s
PublicInbox::Config->new time down to ~0.98s with 50K inboxes.
Diffstat (limited to 'script')
0 files changed, 0 insertions, 0 deletions