Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Profile-Guided Optimization (PGO) results on parsing JSON files #23

Open
zamazan4ik opened this issue Aug 10, 2023 · 0 comments
Open

Profile-Guided Optimization (PGO) results on parsing JSON files #23

zamazan4ik opened this issue Aug 10, 2023 · 0 comments

Comments

@zamazan4ik
Copy link

Hi!

I am doing research about Profile-Guided Optimization (PGO) effects on different kinds of software - my current results are available here. I decided to PGO-optimize json-benchmark and try to estimate the PGO performance boost for that kind of workload.

My test environment is Macbook M1 Pro, Ventura 13.4, with a connected charger (it's important since it affects the results). The results are collected with multiple runs of cargo run --release and choosing the greater results (since the same way is described in the README file). PGO optimization was done with cargo-pgo. My results are the following.

Release:

======= serde_json ======= parse|stringify ===== parse|stringify ====
data/canada.json         440 MB/s   710 MB/s   650 MB/s   510 MB/s
data/citm_catalog.json   830 MB/s   940 MB/s  1400 MB/s  1210 MB/s
data/twitter.json        510 MB/s  1360 MB/s   970 MB/s  1490 MB/s

==== rustc_serialize ===== parse|stringify ===== parse|stringify ====
data/canada.json         250 MB/s   140 MB/s   210 MB/s   100 MB/s
data/citm_catalog.json   350 MB/s   390 MB/s   270 MB/s   470 MB/s
data/twitter.json        200 MB/s   600 MB/s   150 MB/s   670 MB/s

======= simd-json ======== parse|stringify ===== parse|stringify ====
data/canada.json         710 MB/s   770 MB/s   890 MB/s
data/citm_catalog.json  1890 MB/s  1070 MB/s  2290 MB/s
data/twitter.json       1820 MB/s  1630 MB/s  1420 MB/s

PGO-optimized:

======= serde_json ======= parse|stringify ===== parse|stringify ====
data/canada.json         590 MB/s   720 MB/s  1150 MB/s   530 MB/s
data/citm_catalog.json  1100 MB/s  1090 MB/s  1620 MB/s  1210 MB/s
data/twitter.json        600 MB/s  1370 MB/s   990 MB/s  1370 MB/s

==== rustc_serialize ===== parse|stringify ===== parse|stringify ====
data/canada.json         280 MB/s   150 MB/s   230 MB/s   110 MB/s
data/citm_catalog.json   450 MB/s   470 MB/s   340 MB/s   530 MB/s
data/twitter.json        220 MB/s   740 MB/s   170 MB/s   780 MB/s

======= simd-json ======== parse|stringify ===== parse|stringify ====
data/canada.json         740 MB/s   780 MB/s   990 MB/s
data/citm_catalog.json  1900 MB/s  1190 MB/s  2520 MB/s
data/twitter.json       1900 MB/s  1700 MB/s  1620 MB/s

According to these tests, PGO allows us to achieve better performance with parsing JSON files. Hope my tests can help someone. Probably would be a good idea to add the information about PGO to the libraries' documentation somewhere in a "Performance tuning" section.

@zamazan4ik zamazan4ik changed the title Profile-Guided Optimization (PGO) results on Profile-Guided Optimization (PGO) results on parsing JSON files Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant