Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

Add zld linker #1

Merged
merged 3 commits into from
Aug 24, 2020
Merged

Add zld linker #1

merged 3 commits into from
Aug 24, 2020

Conversation

CleanCut
Copy link
Owner

  • Add new zld linker for mac.
  • Add fatal messages to setup script.

I must be doing something wrong. Even though zld appears to both be installed correctly and the config file appears to be formatted correctly, I see absolutely no difference in compile times on my mac. What am I missing? To test, I'm using this repositories' code with the .add_default_plugins() line commented out so that the app immediately exits after running each system once.

/cc @ashneverdawn @cart @lachlansneff from bevyengine/bevy#312

@ashneverdawn
Copy link

The filename should be just config with no extension, rather than config.fast

@ashneverdawn
Copy link

ashneverdawn commented Aug 24, 2020

Also, as an unrelated side note, you may want to use /usr/local/bin/zld for the path instead of /usr/local/Cellar/zld/1.1.0/bin/zld. (See: bevyengine/bevy#314)

@CleanCut
Copy link
Owner Author

The filename should be just config with no extension, rather than config.fast

@ashneverdawn I should clarify that this is after running ./setup which renames .cargo/config.fast to .cargo/config and installs zld. I see no effect whatsoever.

I will update to using the alias, but it's still rather academic if it has no effect. 😢

@CleanCut
Copy link
Owner Author

I made the same alias change as in bevyengine/bevy#314


I tested again...still not seeing any effect. To avoid confusion, here is my testing procedure:

  • Clone the repo: git clone [email protected]:CleanCut/bevy_template
  • Checkout the zld branch: pushd bevy_template && git checkout zld && popd
  • Make a copy of the repository (I don't test in the original clone): cp -r bevy_template mactest
  • Prep the copied repository:
    • cd mactest
    • ./setup
    • Manually verify that .cargo/config is now in place and looks correct.
    • Comment out .add_default_plugins() in src/main.rs so the app exits after running each system once.
  • Do the testing in this mactest project, for example:
    • time cargo run (repeat with and without cargo clean)
    • Edit a line in src/main.rs and run time cargo run, rinse & repeat.

Compared to the same commands in another copy of the project without running ./setup (and not having .cargo/config in place), I see no difference in fresh or incremental compile times.

@ashneverdawn
Copy link

ashneverdawn commented Aug 24, 2020

I cloned the repo and did some tests for incremental compiles:

Case 1: config without zld, without .add_default_plugins()
Case 2: config without zld, with .add_default_plugins()

Case 3: config with zld, without .add_default_plugins()
Case 4: config with zld, with .add_default_plugins()

Case 1 Case 2 Case 3 Case 4
3.05 19.47 2.79 13.97
5.31 17.81 2.16 12.32
3.92 14.70 2.67 13.14
2.37 13.89 2.34 12.45
3.51 16.50 2.27 13.17

I'm running it on a 2014 mac:
2.6 GHz Dual-Core Intel Core i5
8 GB 1600 MHz DDR3
Intel Iris 1536 MB

So, I definitely see a speed improvement on my end. What hardware are you running it on?

@CleanCut
Copy link
Owner Author

CleanCut commented Aug 24, 2020

After discussion with @ashneverdawn on Discord and comparing notes, we discovered that several factors were adding noise to my measurements: 1) using time was adding some startup-time noise, 2) Using time + cargo run was adding some program runtime noise, 3) I am on much higher-end hardware, compressing the total times to begin with, and 4) disabling .add_default_plugins() made my compile sufficiently fast that the noise was dominating the measurements (I was seeing 1.3s-1.7s with and without zld).

By eliminating factors 1, 2 and 4 (only looking at the cargo-reported build time and including .add_default_plugins), I can now see a measurable (though not particularly impressive) difference in my testing:

Case A: Without zld, with .add_default_plugins() (equivalent to Case 2 above) - Average 7.594s
Case B: With zld, with .add_default_plugins() (equivalent to Case 4 above) - Average 6.51s

Case A Case B
7.54 6.70
7.57 6.44
7.59 6.44
7.60 6.47
7.67 6.50

That's about 15% faster with zld.

@CleanCut CleanCut merged commit 07271f8 into master Aug 24, 2020
@CleanCut CleanCut deleted the zld branch August 24, 2020 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants