gtk-rs / gtk4-rs

Rust bindings of GTK 4
https://gtk-rs.org/gtk4-rs/
MIT License
1.75k stars 168 forks source link

Is it possible to improve compile times? #1767

Closed coderedart closed 1 month ago

coderedart commented 1 month ago

I just created the basic gtk button example from the book and ran cargo build --timings on windows 11, ryzen 2600x (12 threads), 16 GB DDR4.

image

95 seconds seems really long on a reasonably powerful machine. Especially considering that gtk is dynamically linked.

I was wondering if there's a way to reduce compile times.

sdroege commented 1 month ago

I think the only way to improve compile times here is optimizing the compiler. My main guess for the long compile times is the huge amount of extension traits used by gio/gtk4.

Outside compile times, using mold as linker improves linking times for gtk4-rs applications considerably.