From 3d52c093ad5ce7a32f8842d9ae020712f9786352 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 12 Jun 2020 23:49:24 +0000 Subject: imap: introduce memory-efficient uo2m mapping Since we limit our mailboxes slices to 50K and can guarantee a contiguous UID space for those mailboxes, we can store a mapping of "UID offsets" (not full UIDs) to Message Sequence Numbers as an array of 16-bit unsigned integers in a 100K scalar. For UID-only FETCH responses, we can momentarily unpack the compact 100K representation to a ~1.6M Perl array of IV/UV elements for a slight speedup. Furthermore, we can (ab)use hash key deduplication in Perl5 to deduplicate this 100K scalar across all clients with the same mailbox slice open. Technically we can increase our slice size to 64K w/o increasing our storage overhead, but I suspect humans are more accustomed to slices easily divisible by 10. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) (limited to 'MANIFEST') diff --git a/MANIFEST b/MANIFEST index a133b71f..1a8d6c68 100644 --- a/MANIFEST +++ b/MANIFEST @@ -355,6 +355,7 @@ xt/git-http-backend.t xt/git_async_cmp.t xt/imapd-mbsync-oimap.t xt/imapd-validate.t +xt/mem-imapd-tls.t xt/mem-msgview.t xt/msgtime_cmp.t xt/nntpd-validate.t -- cgit v1.2.3-24-ge0c7