Skip to content

build: prebuild binary_cache and assetstorage canister asset archives#1061

Merged
mergify[bot] merged 2 commits intomasterfrom
es-binary-assets-archive
Sep 25, 2020
Merged

build: prebuild binary_cache and assetstorage canister asset archives#1061
mergify[bot] merged 2 commits intomasterfrom
es-binary-assets-archive

Conversation

@ghost
Copy link

@ghost ghost commented Sep 24, 2020

It turns out that it takes ~99 seconds to build binary_cache.tgz from the contents of the directory at $DFX_ASSETS.

This change builds both binary_cache.tgz and assetstorage_canister.tgzonce per nix-build, rather than once per cargo build.

The remaining .tgz archives are still built at cargo build time, but they only take a handful of milliseconds to build.

Please note that the trick of pointing $DFX_ASSETS at an empty directory (for cargo check) will no longer work, but it is also no longer necessary.

These were the times observed to build these files prior to this change:

binary_cache elapsed: 99.150417878s
assetstorage_canister elapsed: 466.368594ms
language_bindings elapsed: 1.073618ms
new_project_files elapsed: 4.211441ms
new_project_node_files elapsed: 2.722148ms
Elapsed: 99.636307058s

After: (I didn't bother to break it down by file)

Elapsed: 38.458861ms

This also removes fn add_optional_assets because we no longer build dfx in two stages.

@ghost ghost added the automerge-squash label Sep 25, 2020
@mergify mergify bot merged commit 63953ce into master Sep 25, 2020
@mergify mergify bot deleted the es-binary-assets-archive branch September 25, 2020 00:05
dfinity-bot added a commit that referenced this pull request Sep 29, 2021
mergify bot pushed a commit that referenced this pull request Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant