Skip to content

Instantly share code, notes, and snippets.

@orisano
Last active June 29, 2024 06:21
Show Gist options
  • Save orisano/b4d30946a6a760f1458e86e2844ed528 to your computer and use it in GitHub Desktop.
Save orisano/b4d30946a6a760f1458e86e2844ed528 to your computer and use it in GitHub Desktop.
xml benchmarks
#!/bin/bash
hyperfine --warmup 1 --export-markdown result.md './go-stdlib-count ./out.xml' './eliben-gosax-count ./out.xml' './c-libxmlsax-count ./out.xml' 'python3 etree-count.py ./out.xml' 'python3 lxml-count.py ./out.xml' './xml-stream-parser-count ./out.xml' './orisano-gosax-count ./out.xml' './quick-xml-count ./out.xml'

Original: https://eli.thegreenplace.net/2019/faster-xml-stream-processing-in-go/

out.xml(223MB) was generated by xmlgen -f 2.

Command Note Mean [s] Min [s] Max [s] Relative URL
./go-stdlib-count ./out.xml go 1.22.2 3.094 ± 0.025 3.045 3.132 14.02 ± 0.34 github
python3 etree-count.py ./out.xml Python 3.12.3 2.262 ± 0.023 2.245 2.319 10.25 ± 0.26 github
python3 lxml-count.py ./out.xml Python 3.12.3 2.218 ± 0.015 2.191 2.232 10.05 ± 0.24 github
./xml-stream-parser-count ./out.xml go 1.22.2 1.553 ± 0.008 1.548 1.573 7.04 ± 0.16 gist
./eliben-gosax-count ./out.xml go 1.22.2 1.146 ± 0.010 1.134 1.171 5.19 ± 0.13 github
./quick-xml-count ./out.xml rustc 1.81.0-nightly, release build 0.426 ± 0.031 0.409 0.513 1.93 ± 0.15 gist
./c-libxmlsax-count ./out.xml Apple clang version 14.0.3, -O2 0.365 ± 0.004 0.362 0.374 1.66 ± 0.04 github
./orisano-gosax-count ./out.xml go 1.22.2 0.221 ± 0.005 0.218 0.237 1.00 github
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment