Closed danieleggert closed 6 months ago
Reduce MemoryLayout<MailboxPath>.size and MemoryLayout<MailboxName>.size.
MemoryLayout<MailboxPath>.size
MemoryLayout<MailboxName>.size
Some users have a lot of mailboxes, and reducing the size of these helps.
MailboxName
hashValue: Int
_hashValue: UInt32
MailboxPath
pathSeparator: Character?
_pathSeparator: UInt8
The size of MailboxPath drops from 32 bytes to 13 bytes (on 64 bit).
Nice!
Reduce
MemoryLayout<MailboxPath>.size
andMemoryLayout<MailboxName>.size
.Motivation:
Some users have a lot of mailboxes, and reducing the size of these helps.
Modifications:
MailboxName
: Instead of storinghashValue: Int
(8 bytes on 64 bit), store_hashValue: UInt32
(4 bytes).MailboxPath
: Instead of storingpathSeparator: Character?
(16 bytes on 64 bit), store_pathSeparator: UInt8
(1 bytes).Result:
The size of
MailboxPath
drops from 32 bytes to 13 bytes (on 64 bit).