diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-04-24 23:36:08 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-29 20:26:27 -0500 |
commit | 9dd42dc0daab510a4e68118d89b5543936d2074f (patch) | |
tree | 564abe3ab82dadb55e8436c3bf2b7db5db584816 /README | |
parent | 8a9c666a8c0f46739724e2032cedb451121c4594 (diff) |
makepkg: remove subshelling from check_option and friends
Instead of creating a subshell for each of these checks (of which there
are many), pass in an expected value and make the check_* function do
the comparison for us, returning 0 (match), 1, (mismatch), or 127 (not
found).
For a measureable benefit, I tested this on a fairly simple package,
perl-term-readkey, and counted the number of clone(2) syscalls to try
and isolate those generated by makepkg itself, rather than the user
defined functions. Results as shown below:
336 before
180 after
So, roughly a 50% reduction, which makes sense given that a single
check_option() call could be up to 3 subprocesses in total.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions