Re: [PATCH] Cygwin: Speed up mkimport

2020-12-16 Thread Jon Turney
On 26/11/2020 09:56, Mark Geisert wrote: Cut mkimport elapsed time in half by forking each iteration of the two time-consuming loops within. Only do this if more than one CPU is present. In the second loop, combine the two 'objdump' calls into one system() invocation to avoid a system()

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-28 Thread Achim Gratz
Achim Gratz writes: > That actually works, but the speedup is quite modest on my system > (4C/8T) even though I've allowed it to use unlimited resources. So it > basically forks slower than the runtime for each of the invocations is. > Some more speedup can be had if the assembler is run on

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-28 Thread Achim Gratz
Achim Gratz writes: > b) Open up two pipes to an "xargs -P $ncpu/2 L 1 …" and feed in the file > names. That actually works, but the speedup is quite modest on my system (4C/8T) even though I've allowed it to use unlimited resources. So it basically forks slower than the runtime for each of the

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-27 Thread Brian Inglis
On 2020-11-27 11:37, Achim Gratz wrote: Mark Geisert writes: Still faster than two system commands :-). But thanks for the comment; It still seems you are barking up the wrong tree. I thought I was merely grouping args, to get around Perl's greedy arg list building for the system command.

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-27 Thread Achim Gratz
Mark Geisert writes: > Still faster than two system commands :-). But thanks for the > comment; It still seems you are barking up the wrong tree. > I thought I was merely grouping args, to get around Perl's > greedy arg list building for the system command. Wot? It just takes a list which you

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-27 Thread Mark Geisert
Jon Turney wrote: On 26/11/2020 09:56, Mark Geisert wrote: @@ -86,8 +94,18 @@ for my $f (keys %text) {   if (!$text{$f}) {   unlink $f;   } else { -    system $objcopy, '-R', '.text', $f and exit 1; -    system $objcopy, '-R', '.bss', '-R', '.data', "t-$f" and exit 1; +    if

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-27 Thread Mark Geisert
Achim Gratz wrote: Mark Geisert writes: + # Do two objcopy calls at once to avoid one system() call overhead + system '(', $objcopy, '-R', '.text', $f, ')', '||', + $objcopy, '-R', '.bss', '-R', '.data', "t-$f" and exit 1; That doesn't do what you think it

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-26 Thread Achim Gratz
Mark Geisert writes: > + # Do two objcopy calls at once to avoid one system() call overhead > + system '(', $objcopy, '-R', '.text', $f, ')', '||', > + $objcopy, '-R', '.bss', '-R', '.data', "t-$f" and exit 1; That doesn't do what you think it does. It in fact

Re: [PATCH] Cygwin: Speed up mkimport

2020-11-26 Thread Mark Geisert
Previously, Mark Geisert wrote: Cut mkimport elapsed time in half by forking each iteration of the two time-consuming loops within. Only do this if more than one CPU is present. In the second loop, combine the two 'objdump' calls into one