Cuneiform Fields: Field level cache optimizations for Rust (no_std).
This crate provides cache line size fitting optimizations to fields in structs. It is no_std and can be used in any no_std environment.
This crate aligns fields with #[repr(align(COHERENCE_LINE_SIZE))]
to decrease the time between prefetch signals for data.
COHERENCE_LINE_SIZE
can be detected or decided based on the architecture by cuneiform
itself.
[]
= "0.1"
Examples
Hermetic aligned fields
Align by hermetic cache line size detection mentioned in cuneiform readme:
use *;
In the example above data
will be aligned by hermetic alignment but field data_2
isn't going to be alignment optimized.
Architecture aligned fields
Align by cache line size detected by current Rust compiler architecture. If architecture isn't detected in known architectures it will fall back to default alignment:
use *;
In the example above data
will be aligned by architecture alignment but field data_2
isn't going to be alignment optimized.