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

Optimize code size of FFI binaries #874

Closed
sffc opened this issue Jul 21, 2021 · 4 comments · Fixed by #1449
Closed

Optimize code size of FFI binaries #874

sffc opened this issue Jul 21, 2021 · 4 comments · Fixed by #1449
Assignees
Labels
A-ffi Area: FFI, WebAssembly, Transpilation A-performance Area: Performance (CPU, Memory) C-meta Component: Relating to ICU4X as a whole S-epic Size: Major project (create smaller child issues) T-core Type: Required functionality
Milestone

Comments

@sffc
Copy link
Member

sffc commented Jul 21, 2021

This issue is to track work for optimizing the code size of our FFI binaries in WebAssembly and C++ (the capi crate).

In #951, I identified low-hanging fruit and room for future improvement. I would like to implement that "future improvement" before closing this issue.

@sffc sffc added T-core Type: Required functionality A-performance Area: Performance (CPU, Memory) A-ffi Area: FFI, WebAssembly, Transpilation C-meta Component: Relating to ICU4X as a whole S-large Size: A few weeks (larger feature, major refactoring) labels Jul 21, 2021
@sffc sffc added this to the ICU4X 0.4 milestone Jul 21, 2021
@sffc sffc self-assigned this Jul 21, 2021
@sffc sffc modified the milestones: ICU4X 0.4, 2021 Q3 0.4 Sprint A Aug 11, 2021
@sffc
Copy link
Member Author

sffc commented Aug 11, 2021

Split smaller task into #951.

@sffc sffc added S-epic Size: Major project (create smaller child issues) and removed S-large Size: A few weeks (larger feature, major refactoring) labels Aug 11, 2021
@sffc sffc modified the milestones: ICU4X 0.4, ICU4X 0.5 Sep 26, 2021
@sffc
Copy link
Member Author

sffc commented Dec 10, 2021

With @Manishearth we discovered the source of fmt::Debug continuing to appear in the binaries. rust-lang/rust#91737 is filed to fix that issue. Once that issue is merged, I think we can consider this issue fixed.

#1383 is one additional issue to discuss to further improve code size.

@sffc
Copy link
Member Author

sffc commented Dec 10, 2021

Another potential area of improvement is in Drop impls. These impls carry a lot of code to deallocate things, even if there is never going to be anything to deallocate (for example, in the normal usage of a ZeroVec).

@sffc
Copy link
Member Author

sffc commented Jan 27, 2022

The fixeddecimal_tiny example moved from around 60 KB to around 30 KB during the 0.5 cycle. The exact numbers are in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ffi Area: FFI, WebAssembly, Transpilation A-performance Area: Performance (CPU, Memory) C-meta Component: Relating to ICU4X as a whole S-epic Size: Major project (create smaller child issues) T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant