Giter Site home page Giter Site logo

Get compile times down about citybound HOT 11 OPEN

citybound avatar citybound commented on April 28, 2024
Get compile times down

from citybound.

Comments (11)

kingoflolz avatar kingoflolz commented on April 28, 2024 7

WOOHOO massive improvements in compile times!
on 3570k:
First compile:
Finished release [optimized + debuginfo] target(s) in 88.18 secs
Second compile after very small changes:
Finished release [optimized + debuginfo] target(s) in 5.77 secs
Command used:
cargo rustc --release -- -Zincremental=/tmp/

from citybound.

Herbstein avatar Herbstein commented on April 28, 2024

Any ideas why the compile time is as high as it is? Mine are consistently around 50s and I'm running a 6700K.

from citybound.

kingoflolz avatar kingoflolz commented on April 28, 2024

I think if we have a more recent compiler version, we can take advantage of some of the work that has been going on with incremental compilation in the rust compiler.

I'm not sure what else we can do except for maybe splitting the project into even more crates (as crates is rust's smallest compilation unit, vs files in C/C++)

from citybound.

Herbstein avatar Herbstein commented on April 28, 2024

Using a newer nightly would be nice. Is there a specific language change that prohibits us from upgrading?

Splitting the project up should probably only be done when it makes sense logically, not just as a method to combat compile times.

from citybound.

kingoflolz avatar kingoflolz commented on April 28, 2024

Just attempted to upgrade, but macros have a weird error

error[E0428]: a type named `AddBatch` has already been defined in this module
  --> lib/monet/src/renderer/mod.rs:52:1
   |
51 |   #[derive(Compact, Clone)]
   |            ------- previous definition of `AddBatch` here
52 |   pub struct AddBatch {
   |  _^ starting here...
53 | |     pub scene_id: usize,
54 | |     pub batch_id: u16,
55 | |     pub thing: Thing,
56 | | }
   | |_^ ...ending here: `AddBatch` already defined

error[E0428]: a type named `UpdateThing` has already been defined in this module
  --> lib/monet/src/renderer/mod.rs:71:1
   |
70 |   #[derive(Compact, Clone)]
   |            ------- previous definition of `UpdateThing` here
71 |   pub struct UpdateThing {
   |  _^ starting here...
72 | |     pub scene_id: usize,
73 | |     pub thing_id: u16,
74 | |     pub thing: Thing,
75 | |     pub instance: Instance,
76 | |     pub is_decal: bool,
77 | | }
   | |_^ ...ending here: `UpdateThing` already defined

error[E0428]: a type named `AddSeveralInstances` has already been defined in this module
   --> lib/monet/src/renderer/mod.rs:113:1
    |
112 |   #[derive(Compact, Clone)]
    |            ------- previous definition of `AddSeveralInstances` here
113 |   pub struct AddSeveralInstances {
    |  _^ starting here...
114 | |     pub scene_id: usize,
115 | |     pub batch_id: u16,
116 | |     pub instances: CVec<Instance>,
117 | | }
    | |_^ ...ending here: `AddSeveralInstances` already defined

error[E0428]: a type named `AddDebugText` has already been defined in this module
   --> lib/monet/src/renderer/mod.rs:136:1
    |
135 |   #[derive(Compact, Clone)]
    |            ------- previous definition of `AddDebugText` here
136 |   pub struct AddDebugText {
    |  _^ starting here...
137 | |     pub scene_id: usize,
138 | |     pub key: CVec<char>,
139 | |     pub text: CVec<char>,
140 | |     pub color: [f32; 4],
141 | | }
    | |_^ ...ending here: `AddDebugText` already defined

error[E0428]: a type named `Thing` has already been defined in this module
  --> lib/monet/src/thing.rs:7:1
   |
6  |   #[derive(Compact, Debug)]
   |            ------- previous definition of `Thing` here
7  |   pub struct Thing {
   |  _^ starting here...
8  | |     pub vertices: CVec<Vertex>,
9  | |     pub indices: CVec<u16>,
10 | | }
   | |_^ ...ending here: `Thing` already defined

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `renderer::AddBatch`:
  --> lib/monet/src/renderer/mod.rs:51:10
   |
51 | #[derive(Compact, Clone)]
   |          ^^^^^^^  ----- first implementation here
   |          |
   |          conflicting implementation for `renderer::AddBatch`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `renderer::UpdateThing`:
  --> lib/monet/src/renderer/mod.rs:70:10
   |
70 | #[derive(Compact, Clone)]
   |          ^^^^^^^  ----- first implementation here
   |          |
   |          conflicting implementation for `renderer::UpdateThing`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `renderer::AddSeveralInstances`:
   --> lib/monet/src/renderer/mod.rs:112:10
    |
112 | #[derive(Compact, Clone)]
    |          ^^^^^^^  ----- first implementation here
    |          |
    |          conflicting implementation for `renderer::AddSeveralInstances`

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `renderer::AddDebugText`:
   --> lib/monet/src/renderer/mod.rs:135:10
    |
135 | #[derive(Compact, Clone)]
    |          ^^^^^^^  ----- first implementation here
    |          |
    |          conflicting implementation for `renderer::AddDebugText`

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `thing::Thing`:
 --> lib/monet/src/thing.rs:6:10
  |
6 | #[derive(Compact, Debug)]
  |          ^^^^^^^  ----- first implementation here
  |          |
  |          conflicting implementation for `thing::Thing`

from citybound.

kingoflolz avatar kingoflolz commented on April 28, 2024

Haha managed to get it working from just messing with the macros

from citybound.

kingoflolz avatar kingoflolz commented on April 28, 2024

See #81

from citybound.

Herbstein avatar Herbstein commented on April 28, 2024

That was sorely needed. Doing small changes in the movement code was a nightmare last night. Great job!

from citybound.

aeplay avatar aeplay commented on April 28, 2024

Yes!!!!

from citybound.

aeplay avatar aeplay commented on April 28, 2024

Compile times do seem much better, as long as the changes don't touch the horrible monster-function in game/planning/mod.rs - but that should get better once I address #25

from citybound.

aeplay avatar aeplay commented on April 28, 2024

I started to pull out functionality into crates in c4b2477, in an effort to help the Rust compiler

from citybound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.