tonarino / bomberman-of-the-hill

13 stars 5 forks source link

Use the 'dynamic' bevy feature flag for faster iterative compile times #11

Closed bschwind closed 3 years ago

bschwind commented 3 years ago

Reference: https://bevyengine.org/learn/book/getting-started/setup/

Some rough numbers from a 2020 macbook pro (pre-M1 :c), making a one line change to main.rs and recompiling after the first full build:

Before

brian bomberman-of-the-hill $ cargo build --release -p bomber_game
   Compiling bomber_game v0.1.0 (/Users/brian/projects/tonari/bomberman-of-the-hill/crates/bomber_game)
    Finished release [optimized] target(s) in 19.32s

After

brian bomberman-of-the-hill $ cargo build --release -p bomber_game
   Compiling bomber_game v0.1.0 (/Users/brian/projects/tonari/bomberman-of-the-hill/crates/bomber_game)
    Finished release [optimized] target(s) in 7.19s

Also as a note, we may want to pick and choose which parts of bevy we want to use. A clean build on my machine took 6m 23s.

I have a project which uses just the ECS part of bevy, along with winit and wgpu. It takes 1m 27s for a clean build.

I think it makes sense to start with everything for now, but let's carve it down to size as we understand what we want or don't want.

bschwind commented 3 years ago

@PabloMansanet I'm curious to see what numbers you get, could you post results from your machine just to get one more data point?

PabloMansanet commented 3 years ago

Sure! This is in current main:

[corax](bomberman_of_the_hill)$ cargo build --release -p bomber_game
   Compiling bomber_game v0.1.0 (/home/corax/repos/bomberman_of_the_hill/crates/bomber_game)
    Finished release [optimized] target(s) in 6.74s

And this is in bevy-dynamic:

[corax](bomberman_of_the_hill)$ cargo build --release -p bomber_game
   Compiling bomber_game v0.1.0 (/home/corax/repos/bomberman_of_the_hill/crates/bomber_game)
    Finished release [optimized] target(s) in 4.15s

So not as big, but definitely noticeable.

EDIT: For reference, this is on a System76 Oryx Pro running Arch Linux.

bschwind commented 3 years ago

Thanks for the numbers! I'll try this out on an M1 mac mini later just out of curiosity.

Edit: 4.11s, I'll take it.