Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install-template.sh: speed up this script by reducing # of forks. #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

he32
Copy link

@he32 he32 commented May 24, 2021

Replace inner-loop use of "grep", "sed" and "cut" for pattern matching
and substitution when case/esac and appropriate parameter expansion
works just as well. A test rig shows around 4x speed-up.

Replace inner-loop use of "grep", "sed" and "cut" for pattern matching
and substitution when case/esac and appropriate parameter expansion
works just as well.  A test rig shows around 4x speed-up.
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request May 25, 2021
When building the bootstrap kit, drop "docs" and "compiler-docs"
from the build.  This will make the install of the bootstrap kit
a lot faster, since it drops 5-6.000 files from the kit, which would
need to be processed by the install.sh script.  Note that this will
also impact the rust-bin package, since we also use the bootstrap
kits for installation there for the ports we maintain locally.  To
get these "docs" sub-sets installed, use the full "lang/rust" normal
build and/or a corresponding binary package.

Also, speed up the install.sh script (via install-template.sh) by
significantly reducing the number of forks in the inner loop.
Instead of relying on "grep", "sed" and "cut" for pattern matching,
substitution and field extraction, use case/esac and parameter
expansion modification to do the same, i.e. using in-shell mechanisms.
Submitted upstream, ref.

rust-lang/rust-installer#111

On an emulated (and loaded...) armv7 system, this reduced the time
(as shown with csh "time") for a test rig of install.sh (which
doesn't even actually do the file copying etc.) from

13000.143u 48616.601s 14:21:27.13 119.2%   57+151k 598+7367io 0pf+0w
to
3247.518u 9754.898s 3:45:48.70 95.9%   31+75k 927+4952io 14pf+0w

(This is with the "docs" and "compiler-docs" still in the bootstrap kit.)

Bump PKGREVISION.
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