svd2rust
svd2rust copied to clipboard
Modules (`form`)
Closes #424 .
r? @therealprof
Speed tests are needed
That's very nice! Need to have a closer look this evening.
@therealprof you promised to look
Didn't get to it, sorry. Maybe I can squeeze it in later today.
I had a look. svd2rust
runtime goes through the roof with the -f
option, it takes 10x as long in my tests to dump the code. There's no change in build/check times of the generated code.
It would be great to see some noticeable benefit somewhere.
The Module
is a rather weird implementation causing quite a few clippy lints and warnings in case the superfluous #[allow(dead_code)]
are removed.
We should also get rid of all the panics and instead implement proper error handling.
Any plan on this?
Recently I tried the logic of xtask
in esp-pacs
on d1-pac
, which first generates lib.rs
and then transforms it into modules in src
. Much simpler than this implementation in my mind.
esp-pacs
d1-pac
it takes 10x as long in my tests to dump the code.
I am not familiar with improving performance. Taking a simple look at the flame graph of executing xtask gen d1
, I found that form::create_directory_structure
is indeed costly. But I don't feel it annoying since I always use form
after generating code with svd2rust
.
The flame graph: