Using microprofiler I noticed that bit manipulation seemed way too present in the report, so I did some benchmarking.
Using Register and BitRange to extract 6 bits from a u32 is 150 times slower than direct bit extraction ...
I came across this blog post about BitFields, and this method is on par with direct bit extraction, if not a bit faster.
There's a downside though : BitRanges in Saturnin are defined using the first and last bit of the range, and the extraction is done from there. For BitFields, it's using start bit and length to extract ... so all the declarations so far will have to be updated, but it's worth it.
Using microprofiler I noticed that bit manipulation seemed way too present in the report, so I did some benchmarking. Using Register and BitRange to extract 6 bits from a u32 is 150 times slower than direct bit extraction ...
I came across this blog post about BitFields, and this method is on par with direct bit extraction, if not a bit faster. There's a downside though : BitRanges in Saturnin are defined using the first and last bit of the range, and the extraction is done from there. For BitFields, it's using start bit and length to extract ... so all the declarations so far will have to be updated, but it's worth it.