-
Notifications
You must be signed in to change notification settings - Fork 111
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
Large increase in binary size after upgrading to v0.7.6 #580
Comments
It looks like this has little impact on performance. Inspired by toml-rs#580
It looks like this has little impact on performance. Inspired by toml-rs#580
Happen to know if that was with or without debug symbols? I ran $ cargo bloat --crates --release --example decode
warning: skipping duplicate package `example` found at `/home/epage/.cargo/git/checkouts/libfuzzer-sys-e07fde05820d7bc
6/35ce7d7/example`
Finished release [optimized + debuginfo] target(s) in 0.02s
Analyzing target/release/examples/decode
File .text Size Crate
2.5% 52.4% 270.7KiB std
2.0% 41.6% 214.5KiB toml_edit
0.1% 1.7% 8.7KiB winnow
0.0% 0.8% 4.3KiB serde
0.0% 0.5% 2.3KiB libtest_mimic
0.0% 0.3% 1.8KiB toml_datetime
0.0% 0.3% 1.4KiB decode
0.0% 0.2% 1.0KiB regex
0.0% 0.1% 555B ignore
0.0% 0.1% 440B memchr
0.0% 0.0% 260B serde_spanned
0.0% 0.0% 133B toml
0.0% 0.0% 109B [Unknown]
0.0% 0.0% 95B hashbrown
0.0% 0.0% 83B indexmap
0.0% 0.0% 38B clap
0.0% 0.0% 5B libc
4.7% 100.0% 516.2KiB .text section size, the file size is 10.6MiB Re-ran it with toml 0.5 $ cargo bloat --crates --release --example decode
warning: skipping duplicate package `example` found at `/home/epage/.cargo/git/checkouts/libfuzzer-sys-e07fde05820d7bc
6/35ce7d7/example`
Compiling toml v0.5.10
Compiling toml v0.7.6 (/home/epage/src/personal/toml/crates/toml)
Finished release [optimized + debuginfo] target(s) in 2.51s
Analyzing target/release/examples/decode
File .text Size Crate
4.1% 70.6% 270.8KiB std
1.3% 23.4% 89.6KiB toml
0.1% 2.5% 9.7KiB serde
0.0% 0.9% 3.3KiB libtest_mimic
0.0% 0.2% 761B decode
0.0% 0.2% 726B hashbrown
0.0% 0.1% 555B ignore
0.0% 0.1% 440B memchr
0.0% 0.0% 166B indexmap
0.0% 0.0% 109B [Unknown]
0.0% 0.0% 5B libc
5.7% 100.0% 383.4KiB .text section size, the file size is 6.5MiB
Note: numbers above are a result of guesswork. They are not 100% correct and never will be. So
commit 6e63746 After a couple of tweaks (#585), I dropped a little of the size $ cargo bloat --release --example decode --crates
warning: skipping duplicate package `example` found at `/home/epage/.cargo/git/checkouts/libfuzzer-sys-e07fde05820d7bc
6/35ce7d7/example`
Compiling toml_edit v0.19.13 (/home/epage/src/personal/toml/crates/toml_edit)
Compiling toml v0.7.6 (/home/epage/src/personal/toml/crates/toml)
Finished release [optimized + debuginfo] target(s) in 3.31s
Analyzing target/release/examples/decode
File .text Size Crate
2.5% 53.8% 269.4KiB std
1.9% 40.1% 200.8KiB toml_edit
0.1% 1.7% 8.7KiB winnow
0.0% 0.9% 4.3KiB serde
0.0% 0.5% 2.3KiB libtest_mimic
0.0% 0.4% 1.8KiB toml_datetime
0.0% 0.3% 1.4KiB decode
0.0% 0.2% 1.0KiB regex
0.0% 0.1% 555B ignore
0.0% 0.1% 440B memchr
0.0% 0.1% 260B serde_spanned
0.0% 0.0% 133B toml
0.0% 0.0% 109B [Unknown]
0.0% 0.0% 95B hashbrown
0.0% 0.0% 83B indexmap
0.0% 0.0% 38B clap
0.0% 0.0% 5B libc
4.7% 100.0% 501.0KiB .text section size, the file size is 10.5MiB
Note: numbers above are a result of guesswork. They are not 100% correct and never will be. |
From looking at the function sizes, my best guesses as to where the size is going
I should note that the example I was measuring only deserializes so all of the serialization code was optimized out. |
All the debug symbols were stripped out in the builds I posted, and it should have also just been deserialization. I'll see if I can get a |
Version
Version
Strangely, binary size increased slightly on every target other than x86_64 after updating to |
Recently, I ran a
cargo update
on my project, and the release binary size jumped ~0.13MB. Relevant CI builds are https://github.com/ravenclaw900/DietPi-Dashboard/actions/runs/5523750813 (old) and https://github.com/ravenclaw900/DietPi-Dashboard/actions/runs/5524904223 (new). I am aware that this was mentioned in #340 (comment) and is a known 'regression'. I also understand that the oldtoml
crate was unmaintained, and didn't fully support TOML 1.0. All that to say, I am in favor of the new parser and what it does, but I'm wondering why the increase in binary size was so large and if there's anything that can be done on either end to reduce the size?The text was updated successfully, but these errors were encountered: