Skip to main content

UNROLL

Constant UNROLL 

Source
pub const UNROLL: usize = 32;
Expand description

The most moves a copy or a fill becomes before it is left alone for a call instead.

Thirty two, which is two hundred and fifty six bytes at a word a time and is a structure larger than almost every one a program writes. What the number is trading is code size against a call, and the exchange rate is a machine’s rather than a language’s, so the number lives here next to the code it bounds and not in a target description that would have to be right about it for every target at once.

It is a count of moves and not a count of bytes because that is what the cost is. A copy of sixty four bytes between two addresses aligned to eight is eight moves and a copy of the same sixty four bytes between two addresses aligned to one is sixty four, and the second is the expensive one whatever the size says.