I build and maintain a library for parsing property list files in Rust, plist-rs, and I created benchmarks to compare it to the other common plist parsing libraries:
$ rustup run nightly cargo bench --features libplist
Running target/release/comparison-1b39fc719adbc926
running 6 tests
test foundation::bench_binary ... bench: 2,214,275 ns/iter (+/- 785,637)
test foundation::bench_xml ... bench: 7,600,543 ns/iter (+/- 1,284,842)
test libplist::bench_binary ... bench: 4,147,479 ns/iter (+/- 1,656,727)
test libplist::bench_xml ... bench: 13,847,505 ns/iter (+/- 6,601,819)
test rust::bench_binary ... bench: 2,303,294 ns/iter (+/- 1,778,663)
test rust::bench_xml ... bench: 32,686,229 ns/iter (+/- 5,390,257)
test result: ok. 0 passed; 0 failed; 0 ignored; 6 measured
The XML property list parser in plist-rs is based on xml-rs, and as you can see it is twice as slow as libplist which uses libxml and four times as slow as NSPropertyListSerialization (Apple's implementation) which uses a custom XML parser.
Just wanted to open this as a tracking issue to investigate where the issues are.
I build and maintain a library for parsing property list files in Rust, plist-rs, and I created benchmarks to compare it to the other common plist parsing libraries:
$ rustup run nightly cargo bench --features libplist Running target/release/comparison-1b39fc719adbc926 running 6 tests test foundation::bench_binary ... bench: 2,214,275 ns/iter (+/- 785,637) test foundation::bench_xml ... bench: 7,600,543 ns/iter (+/- 1,284,842) test libplist::bench_binary ... bench: 4,147,479 ns/iter (+/- 1,656,727) test libplist::bench_xml ... bench: 13,847,505 ns/iter (+/- 6,601,819) test rust::bench_binary ... bench: 2,303,294 ns/iter (+/- 1,778,663) test rust::bench_xml ... bench: 32,686,229 ns/iter (+/- 5,390,257) test result: ok. 0 passed; 0 failed; 0 ignored; 6 measuredThe XML property list parser in
plist-rsis based onxml-rs, and as you can see it is twice as slow as libplist which useslibxmland four times as slow as NSPropertyListSerialization (Apple's implementation) which uses a custom XML parser.Just wanted to open this as a tracking issue to investigate where the issues are.