-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
[wip] optimize for eventual library size #1087
Conversation
looks like this actually breaks windows builds |
now the PR is just adding link-time-optimizations which, if i see it correctly, provide a significant reduction of compile time size. and this seems to work for windows as well. @r10s would be good to know if the new commit on this branch here still leads to a significant reduction of the apk. maybe you can trigger it again sometime ;) This does reduce the information (i guess) that you get with traces/crashes but maybe it's good to offer a full-debug build on get-dc and a size-optimized apk for gplay / get.delta.chat. If we automate apk-building this could all happen automatically ;) |
deltachat-ffi/Cargo.toml
Outdated
@@ -10,6 +10,11 @@ license = "MIT OR Apache-2.0" | |||
keywords = ["deltachat", "chat", "openpgp", "email", "encryption"] | |||
categories = ["cryptography", "std", "email"] | |||
|
|||
#[profile.release] |
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.
Remove these commented out sections.
Maybe some link time optimizations during JNI/Python bindings building also can be used, since only at this point the compiler knows which functions are actually used. |
seems a if with only link-time-optimizations only half of the size-saving is possible:
so, instead of 18mb only 11mb are saved. still not bad, though. |
new stats:
|
On Sat, Dec 21, 2019 at 04:19 -0800, björn petersen wrote:
new stats:
```
-rw-r--r-- 64401673 Dec 20 17:15 deltachat-gplay-release-1.0.2.apk
-rw-r--r-- 46354476 Dec 20 18:12 deltachat-gplay-release-1.0.2-opt-size.apk
-rw-r--r-- 53425757 Dec 21 02:01 deltachat-gplay-release-1.0.2-lto-only.apk
-rw-r--r-- 47303123 Dec 21 12:59 deltachat-gplay-release-1.0.2-lto-opt2.apk
```
k, but it seems it is the "opt-level = 'z'" that breaks windows.
because lto-only did pass the windows tests.
|
Our Windows builds are for i686 architecture, so it is likely that |
i686 is simply 32bit version on Windows, I think this is more likely to be a compiler bug tbh
…On 21. Dec 2019, 20:21 +0100, Alexander Krotov ***@***.***>, wrote:
Our Windows builds are for i686 architecture, so it is likely that opt-level="z" exposes some memory corruption issue that we don't have on 32-bit architectures. We can try adding i686 builds for Linux to CI and see if they break as well.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@dignifiedquire Sorry, I mean 64-bit architectures, corrected it now. These optimizations are done by LLVM and I expect it to be pretty stable. |
we have lto=true already in, moving to resurrection. |
Right now, our release mode optimizes for speed.
As per https://github.com/johnthagen/min-sized-rust this PR tries three-settings to build a size-optimized release. Idea is to check what is the influence on the resulting apk and other artifacts.