#Compilation time

46 messages · Page 1 of 1 (latest)

cyan swan
#

So my old project used to take like 10 seconds to compile with all the optimisation features enabled and it only said like "compiling game" or something and then ran. For some reason my new one compiles like a million things before running and takes like 2 minutes. I have the same optimisation features enabled.

tropic knoll
#

Does this happen on every recompile or only on the first compilation?

cyan swan
#

every recompile

#

the old one also used to do that

#

and it just stopped randomly after a while without me changing anything in the toml file

tropic knoll
#

it's a bit hard to say, but it kinda seems like you are doing something that is causing your whole project to compile from scratch everytime

cyan swan
#

Yea thats what I was thinking too

#

But it shouldnt do thay

#

That*

#

Let me know if you know why it does that. I can't figure it out

hexed cave
cyan swan
cyan swan
#

how do I set the incremental thing to true?

cyan swan
#

I can't really figure out why this is happening

#

it just recompiles the whole thing all over again every time I run it

#

the more crates I add the longer it takes

#

it got to like 5 mins on my old project before it stopped doing it

hexed cave
#

have you checked your user-level cargo.toml?

$CARGO_HOME/config.toml which defaults to:
Windows: %USERPROFILE%\.cargo\config.toml
Unix: $HOME/.cargo/config.toml
cyan swan
#

I have not

#

I will when I have time

#

I gotta go out for a little bit

jolly blade
#

I think somebody else had a similar issue, are you using RLS or rust-analyzer? What are you using for an IDE?

jolly blade
#

Have you ran cargo clean? Show your workspace Cargo.toml too

cyan swan
#

one second

#

i have not ran cargo clean, this is the toml file:

[package]
name = "game"
version = "0.1.0"
edition = "2021"

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.9.1", features = ["dynamic"] }
leafwing-input-manager = "0.8.0"

and I'm not sure what you mean by workspace

#

what does cargo clean do?

jolly blade
#

cargo clean nukes your build directory so it will be a fresh build. This often fixes this kind of issue for me. By workspace I just mean your project folder. Try adding resolver = 2 under the package section. Then cargo update and cargo clean.

cyan swan
#

That didn't fix it

jolly blade
#

can you share a build log? like what your terminal spits out while compiling

cyan swan
#

Compiling typenum v1.16.0
Compiling taffy v0.1.0
Compiling bevy_ui v0.9.1
Compiling bevy_internal v0.9.1
Compiling bevy_dylib v0.9.1
Compiling bevy v0.9.1
Compiling leafwing-input-manager v0.8.0
Compiling game v0.1.0 (C:\Users\eneva\Desktop\programming\rust\Unpublished\9\game)
Finished dev [optimized + debuginfo] target(s) in 1m 04s
Running target\debug\game.exe

#

this is a brand new project though its jsut a window and a 2d camera

#

the more dependencies I add the longer it will get

jolly blade
#

try cargo run --verbose

cyan swan
jolly blade
#

So there's a lot of things that could cause this

  1. is your system time set properly?
  2. what version of rust are you using?
  3. disable rust-analyzer, compile from the command line. Does this still occur?
cyan swan
#

My system time is set properly
I'm using the latest stable version of rust
I'm gonna try that one second

#

I got the same thing after I disabled the rust analyzer

cyan swan
#

I literally did absolutely nothing to the toml file and now it takes like 2 seconds to compile

#

went from 2 mins to 1-2 seconds and I literally did nothing to the toml file

jolly blade
#

Gotta love when that happens. Glad to hear you got it resolved

cyan swan
#

I wouldn't call that resolved

#

It is fine now but I have no idea why it's fine