Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change xml crate #109

Open
MarcoIeni opened this issue Apr 3, 2020 · 1 comment
Open

Change xml crate #109

MarcoIeni opened this issue Apr 3, 2020 · 1 comment

Comments

@MarcoIeni
Copy link
Contributor

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.

@burrbull
Copy link
Member

burrbull commented Nov 6, 2021

svd-parser now uses roxmltree which even faster
svd-encoder still uses xmltree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants