Open Bug 1779651 Opened 2 years ago Updated 2 years ago

use SmallVec<[u8; 17]> to store stash serials in cert_storage

Categories

(Core :: Security: PSM, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: keeler, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [psm-blocked])

Attachments

(1 file)

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.

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.

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.

Flags: needinfo?(dkeeler)
Flags: needinfo?(bugs)
Flags: needinfo?(bugs)

This is on hold until we confirm it's a useful change to make.

Flags: needinfo?(dkeeler)
Assignee: dkeeler → nobody
Priority: P1 → P3
Whiteboard: [psm-assigned] → [psm-blocked]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: