Closed burrbull closed 7 months ago
My crate is very similar to yours, and the PAC is also similar. So I don't think there will be a big difference. I don't understand how I can measure the compile time. Just the example build or HAL and PAС?
before PR vs after PR
qei 29656/9504 vs 30268/9504
pwm 35004/9524 vs 35612/9524
Sorry, I haven't finished the more complex examples yet.
I don't understand how I can measure the compile time
You just need to cargo clean
and then
cargo build --timings
(+ --release
). After finish cargo generates html report and prints a link to it. Doesn't matter what you are building example or HAL. It show compilation time of each dependency.
Got it. I mean what time do you need? HAL compile or PAC + HAL?
I've measured just a PAC compilation time. Sure a full time is also interesting, as this PR may also affect on linking time. But I don't see good way to estimate difference.
cargo build --release -j1 --timings --example qei --features at32f415
PAC compile time:
6.7±0.15s vs 6.5±0.05s
This is retry of one of my old experiments.
It does 2 things:
offset
from field writer generic to struct field.Generated code is much simpler.
The main advantage is you can now simply use
.write(|w| w.fname(3).set_bit()
for write/modify field arrays (previously only reading was accepted) same as.write(|w| w.fname3().set_bit()
.The main disadvantage is bigger firmware size in debug mode.
cc @kossnikita, @therealprof and anyone who want to help.
I tried several examples from
stm32f4xx-hal
:So it is 2-3% bigger on debug mode for me.
cargo build --release -j1 --timings
. time ofstm32f4
(f411) compilation on my machine, dependencies not included and peak memory usage duringrtic-usart-shell
compilation: