public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: Speed up mkimport
Date: Fri, 27 Nov 2020 01:56:02 -0800	[thread overview]
Message-ID: <ee4d7296-e9b3-13c8-cc15-f2e393b42e6f@maxrnd.com> (raw)
In-Reply-To: <87wny76eur.fsf@Rainer.invalid>

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 does.  It in fact increases the
> overhead since it'll start a shell that runs those two commands sand
> will even needlessly start the first objcopy in a subshell.

Still faster than two system commands :-).  But thanks for the comment; I thought 
I was merely grouping args, to get around Perl's greedy arg list building for the 
system command.  After more experimenting I ended up with:
             system '/bin/true', '||', $objcopy, '-R', '.text', $f, '||',
                 $objcopy, '-R', '.bss', '-R', '.data', "t-$f" and exit 1;
Kind of ugly, but better?  It obviates the need for parent to pace itself so the 
enclosing loop runs a bit faster.

..mark

  reply	other threads:[~2020-11-27  9:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  9:56 Mark Geisert
2020-11-26 10:07 ` Mark Geisert
2020-11-26 20:30 ` Achim Gratz
2020-11-27  9:56   ` Mark Geisert [this message]
2020-11-27 18:37     ` Achim Gratz
2020-11-28  2:33       ` Brian Inglis
2020-11-28 16:57       ` Achim Gratz
2020-11-28 19:31         ` Achim Gratz
2020-12-16 14:29 ` Jon Turney
2020-11-27 10:07   ` Mark Geisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee4d7296-e9b3-13c8-cc15-f2e393b42e6f@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).