use SmallVec<[u8; 17]> to store stash serials in cert_storage
Categories
(Core :: Security: PSM, enhancement, P3)
Tracking
()
People
(Reporter: keeler, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [psm-blocked])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Apparently loading a crlite stash into memory uses a small but still substantial fraction of all heap allocations upon startup. Since the vast majority of them are 17 bytes or less (99% on the current stash) and ~2/3 of them are exactly 16 or 17 bytes (again on the current stash), we could use SmallVec<[u8; 17]>
to allocate them more efficiently.
Reporter | ||
Comment 1•2 years ago
|
||
Stashes contain many serial numbers. To store them as Vec<u8> requires two heap
allocations each: one for the Vec's members and another for the storage. Almost
all serial numbers are 17 bytes or less, and the majority are exactly 16 or 17
bytes. Thus, using SmallVec<[u8; 17]> will efficiently store this data while
avoiding an extra heap allocation in almost all cases.
Comment 2•2 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:keeler, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
This is on hold until we confirm it's a useful change to make.
Reporter | ||
Updated•2 years ago
|
Description
•