-
Notifications
You must be signed in to change notification settings - Fork 248
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
Track permissions as bytes #540
base: master
Are you sure you want to change the base?
Track permissions as bytes #540
Conversation
This looks great to me. I take it |
We need to parse up to the pathname anyways, in order to be confident the parse is correct. However, once we have done so, we can simply discard this information, yes. I experimented with doing that but the generated rlib got bigger, surprisingly, and I figured it might reduce the final built and optimized size, but that required shoving it inside the stdlib and actually building a binary to test so I deferred that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough!
86213f9
to
74b97aa
Compare
I'm going to hold onto this PR since it almost certainly should result in a (small) final-binary diff until either @Kobzol or myself fix the CI check so graciously added, apologies for the noise. |
74b97aa
to
1616c9d
Compare
Because we expect certain inputs, we don't need chars. The code also doesn't need to validate exact lengths. This reduces the generated code size slightly.
1616c9d
to
25bddbf
Compare
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 512760B |
That sounds unlikely! |
However, more importantly: it sounds! Thanks, @Kobzol! |
Did you expect a larger increase? Currently we just compile a hello world program with |
I expected a decrease, actually! Let me tinker with the build settings, then. |
First pass: Let's try my hypothesis that discarding all the fields will decrease the built size. |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Okay, opt-level doesn't make a difference, but 24 bytes less means I am on to something! Maybe! |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
This reverts commit 6ff19b3.
485688d
to
3ad33ff
Compare
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
well that backfired lmao. |
3ad33ff
to
cb775f1
Compare
a5523dc
to
6a05e64
Compare
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
This reverts commit 25bddbf.
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
1 similar comment
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
This may eliminate some of the overhead of a getter. Also use a slightly more modern code style.
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
1 similar comment
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
This reverts commit 06ccd70.
b3680fb
to
3a4e308
Compare
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
This reverts commit 3a4e308.
Below is the size of a hello-world Rust program linked with libstd with backtrace. Original binary size: 513128B |
Because we expect certain inputs, we don't need chars. The code also doesn't need to validate exact lengths. This reduces the generated code size slightly.
I have some more exciting experiments which I am hoping may take off more in final Rust binaries, but which increase the intermediate rlib by more, so this is the only unequivocal win.