parallel: {{perlexpr}} improved.

This commit is contained in:
Ole Tange 2014-06-26 02:10:43 +02:00
parent 9fed0bfa17
commit c21034b33b
3 changed files with 9 additions and 8 deletions

View file

@ -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?

Binary file not shown.

View file

@ -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.