Module management and compile time


I currently have some broad modules:


Each module contains some other module. For example, A:

  ecs/ (exposing ecs/)
  gs/ (use ecs) (exposing gs/) (exposing A/) (use A)

I noticed my compilation time (cargo run --package A --bin A) are slowly increasing (specially the last step of the compilation. Linkinq?).

My question is: Can I expect a decrease in compilation reorganizing my modules as:

ecs/ (exposing ecs/)
gs/ (use ecs) (exposing gs/)
A/ (use ecs and gs)

Thanks in advance! :slight_smile:

Are you looking for cargo workspaces?

Thanks! :slight_smile:

My answer is maybe.

In my first (aka: current situation) example, A, B and C are combined by a global Cargo.toml:

members = [
    "A", "B", "C"

Will I have benefits using more (aka many) workspaces?


members = [
    "A", "ecs", "gs", "B" "b_foo", "b_bar", "C", etc.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.