Skip to main content

Module interned

Module interned 

Source
Expand description

Ids a coverage report names over and over, stored once.

A report says, for every obligation and line, which tests and phases reached it, and for every test and phase, what it reached. On a 3,900-test run that is some twenty million names drawn from a few tens of thousands of distinct ones – test ids, phase ids, obligation ids and file paths. Held as owned strings each was its own allocation of about a hundred bytes, and analysing that run peaked above 4 GB. An Id is a shared pointer to one copy: sixteen bytes in a list, and a clone is a count. It serializes as the string it holds, so nothing a report writes changes.

Structs§

FxHasher
The hash an analysis’s own maps of ids use: Fx, the multiply-rotate hash rustc uses for its tables. The standard SipHash resists keys chosen to collide, which costs a run’s millions of lookups of its own ids – test, phase and obligation names it made itself – and buys them nothing.
Id
Interner
One Id per distinct text, for the life of one view.

Type Aliases§

FastHash
FastMap
FastSet