Smithay / wayland-rs

Rust implementation of the wayland protocol (client and server).
MIT License
1.07k stars 121 forks source link

Improve binary size #275

Open kstrafe opened 5 years ago

kstrafe commented 5 years ago

This library is currently the bloatiest part of my application according to cargo bloat --release:

0.1% 2.8% 123.4KiB wayland_sys wayland_sys::client::WaylandClient::open

123.4 KiB is a lot of data, this data is included when using gfx-hal. Is there any way to cut this down?

elinorbgr commented 5 years ago

This is the code that finds libwayland-client.so, dlopens it, and loads all the necessary symbols from it: https://github.com/Smithay/wayland-rs/blob/master/wayland-sys/src/client.rs#L17

This code is generated using the macro provided by dlib. If you have any idea how to reduce this size, I'm honestly all ears.