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

Improve compile times of eframe #4481

Open
emilk opened this issue May 11, 2024 · 0 comments
Open

Improve compile times of eframe #4481

emilk opened this issue May 11, 2024 · 0 comments
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers help wanted Extra attention is needed

Comments

@emilk
Copy link
Owner

emilk commented May 11, 2024

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
@emilk emilk added help wanted Extra attention is needed dependencies Pull requests that update a dependency file good first issue Good for newcomers labels May 11, 2024
emilk added a commit that referenced this issue May 11, 2024
Less dependencies => faster compile times

* Part of #4481
emilk added a commit that referenced this issue May 11, 2024
Less dependencies => faster compile times

* Part of #4481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant