Skip to content

Optimise copying of data inputs in npm_install and yarn_install#41

Merged
Silic0nS0ldier merged 2 commits intomainfrom
jordan-mele_optimise-copying
Dec 4, 2023
Merged

Optimise copying of data inputs in npm_install and yarn_install#41
Silic0nS0ldier merged 2 commits intomainfrom
jordan-mele_optimise-copying

Conversation

@Silic0nS0ldier
Copy link
Contributor

repository_ctx.___ actions (e.g. spawning a process, working with files) are very slow vs. most other environments. To optimise copying data dependencies this PR refactors _copy_data_dependencies to;

  1. Create an input files list and write it to a file (avoids the argument length limits).
  2. Performs copy in a shell script using tar.

tar was selected as;

  • Easy to preserve the desired directory structure (BSD cp only does this for directory copying, GNU cp can via --parents).
  • Built in support for an inputs list via --files-from.

rsync would likely represent a more optimal solution, however I'm not very familiar with it. It may make sense as a follow up if there is sufficient room for improvement.

Copy link
Contributor

@christianscott christianscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Silic0nS0ldier Silic0nS0ldier merged commit f26a72c into main Dec 4, 2023
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.

2 participants