mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
parallel: {{perlexpr}} improved.
This commit is contained in:
parent
9fed0bfa17
commit
c21034b33b
|
@ -6185,11 +6185,12 @@ sub simple_replace_placeholders {
|
||||||
my $n = $#args+1;
|
my $n = $#args+1;
|
||||||
if($target =~ /\{\{.*?\}\}/) {
|
if($target =~ /\{\{.*?\}\}/) {
|
||||||
# Replace {{perlexp}} with value
|
# Replace {{perlexp}} with value
|
||||||
for my $a (@args) {
|
@_ = map { $_->replace('{}',$quote) } @args;
|
||||||
$_ = $a->replace('{}',$quote);
|
for(@_) {
|
||||||
$target =~ s/(\{\{(.*?)\}\})/eval("$2")." ".$1/eg;
|
$target =~ s/(\{\{(.*?)\}\})/eval("$2");$_." ".$1/eg;
|
||||||
|
# $target =~ s/(\{\{(.*?)\}\})/eval("$2")." ".$1/eg;
|
||||||
}
|
}
|
||||||
$target =~ s/(\{\{(.*?)\}\})//g;
|
$target =~ s/( \{\{(.*?)\}\})//g;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Which replace strings are used?
|
# Which replace strings are used?
|
||||||
|
|
BIN
src/parallel.pdf
BIN
src/parallel.pdf
Binary file not shown.
|
@ -4080,9 +4080,8 @@ echo 1,2,3 | parallel -vkd, "echo 'a'"@{@}"'b'"
|
||||||
@node Startup
|
@node Startup
|
||||||
@subsection Startup
|
@subsection Startup
|
||||||
|
|
||||||
GNU @strong{parallel} is slow at starting up - around 250 ms. Half of the
|
GNU @strong{parallel} is slow at starting up - around 250 ms the first time
|
||||||
startup time is spent finding the maximal length of a command
|
and 150 ms after that.
|
||||||
line. Setting @strong{-s} will remove this part of the startup time.
|
|
||||||
|
|
||||||
@node Job startup
|
@node Job startup
|
||||||
@subsection Job startup
|
@subsection Job startup
|
||||||
|
@ -4090,7 +4089,8 @@ line. Setting @strong{-s} will remove this part of the startup time.
|
||||||
Starting a job on the local machine takes around 3 ms. This can be a
|
Starting a job on the local machine takes around 3 ms. This can be a
|
||||||
big overhead if the job takes very few ms to run. Often you can group
|
big overhead if the job takes very few ms to run. Often you can group
|
||||||
small jobs together using @strong{-X} which will make the overhead less
|
small jobs together using @strong{-X} which will make the overhead less
|
||||||
significant.
|
significant. Or you can run multiple GNU @strong{parallel}s as described in
|
||||||
|
@strong{EXAMPLE: Speeding up fast jobs}.
|
||||||
|
|
||||||
Using @strong{--ungroup} the 3 ms can be lowered to around 2 ms.
|
Using @strong{--ungroup} the 3 ms can be lowered to around 2 ms.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue