Skip to content
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

[SR-11744] Decrease Swift Runtime Size (for use on embedded devices) #3376

Open
swift-ci opened this issue Nov 9, 2019 · 4 comments
Open

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2019

Previous ID SR-11744
Radar None
Original Reporter allright (JIRA User)
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 3
Component/s Foundation, Standard Library
Labels Improvement, CodeSize, Performance
Assignee None
Priority Medium

md5: a854b179881f306ef61ed6d148fea3b9

Issue Description:

Too big size of:

libicudataswift.so (26.9 Mb)

libFoundation.so (13.2 Mb)

It is possible to use Swift on Android native level(under JNI) for cross-platform business-logic, and some middle-level UI code (ViewModels & etc) (MVVM pattern).

But it dramatically increase Android App Size.

But in comparison with C++, it is too big libraries size.

Is it possible to decrease, or to make special "embedded" version of swift RunTime?

Is it possible to compile for different ARM processors?

Is it possible to remove some unneeded parts while building library?

Is it possible to remove some safety code from Swift libraries, to decrease the size?

Also may be a good decision will be to use static libraries for embedded use.

Example project is Readdle:

https://blog.readdle.com/why-we-use-swift-for-android-db449feeacaf

@finagolfin
Copy link
Contributor

This is significantly reduced since the libicu dependency of the standard library was removed last month:

apple/swift#40340

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Oct 8, 2022

This is significantly reduced since the libicu dependency of the standard library was removed last month:

apple/swift#40340

Too big size of:
libicudataswift.so (26.9 Mb)
libFoundation.so (13.2 Mb)

Hi @buttaface , would you like to share the reduced size here?

And after that PR, would this still be a issue worth tracking on?

@finagolfin
Copy link
Contributor

finagolfin commented Oct 8, 2022

Hi @buttaface , would you like to share the reduced size here?

I reported last year that that change reduced the size of a statically-linked "hello world" Swift executable by ~80%.

And after that PR, would this still be a issue worth tracking on?

It depends on whether the person who raised all these issues still needs some of those addressed.

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Oct 8, 2022

Hello @allright (assume you were the one originally raised the issue)

Are you satisfied with the current status and do you think this still is an issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants