rust-embedded / rust-embedded/svd
Change xml crate
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 84
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
I am working on this issue and I noticed that this library is really slow if compared to what I built by using quick-xml.
I am assuming that the difference of performances is due to the different xml library used.
If you want to compare the two solutions:
git clone -b riir https://github.com/MarcoIeni/svdtools
cd svdtools
# try version the version with quick-xml
git checkout be257c679028d10c6d86e0ae9c869a0ee421cb7c
cargo build --release
time ./target/release/svdtools mmap example/stm32l4x2.svd
# try the version that uses svd-parser
git checkout fad7abfd923312ec95f307286a05017be1218217
cargo build --release
time ./target/release/svdtools mmap example/stm32l4x2.svd
These are the results I get on my laptop by running the executable about ten times:
quick-xml version:
minimum: 0.03s user 0.02s system 79% cpu 0.066 total
maximum: 0.08s user 0.01s system 87% cpu 0.100 total
svd-parser version:
minimum: 0.26s user 0.02s system 96% cpu 0.291 total
maximum: 0.30s user 0.02s system 95% cpu 0.332 total
Of course the version I built by using quick-xml is incomplete and doesn't handle errors well (I originally wrote it because I didn't know this crate existed), but I just wanted to tell you that I saw this huge performance difference.
Of course I know that these benchmark are not rigorous, but I think that they are sufficient at least to raise this point to your attention.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the quick-xml and svd-parser comparisons using the commands in the issue and example/stm32l4x2.svd. Compare the implementations at the referenced commits, including error handling, and verify that the selected XML library improves the reported runtime without leaving parsing behavior incomplete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100