emilk/egui

Improve compile times of `eframe`

Open

#4.481 geöffnet am 11. Mai 2024

Auf GitHub ansehen
 (4 Kommentare) (6 Reaktionen) (0 zugewiesene Personen)Rust (2.037 Forks)batch import
dependenciesgood first issuehelp wanted

Repository-Metriken

Stars
 (29.051 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 20h) (47 gemergte PRs in 30 T)

Beschreibung

eframe currently compiles in about 10s on my M3 MacBook Pro, as measured by

cargo clean && cargo build --timings -p eframe 

Getting rid of proc-macros

A lot of that time is waiting for proc-macro and syn so that we can start compiling bytemuck, thiserror, and foreign-types-macros (used by core-graphics, which is used by winit).

Getting rid of the proc-macros in bytemuck should be simple (replace by manual implementation of its unsafe traits for Color32, Vertex etc). Likewise, replacing thiserror should also be fairly trivial.

I haven't looked into foreign-types, but even removing some proc-macro usage should allow some crates to start compiling earlier, hopefully reducing the total end-to-end compilation time.

Other stuff

  • ahash has a build.rs takes a full second to run
  • icrate takes 5-6 seconds of CPU time

wgpu

Switching glow for wgpu adds another 10s, i.e. doubling the compilation time. To investigate the compilation time of wgpu, run:

cargo clean && cargo build --timings -p wgpu

Contributor Guide