bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [7606] shell builtin "test" not invoked if appears alone


From: Paul D. Smith
Subject: Re: [7606] shell builtin "test" not invoked if appears alone
Date: Fri, 6 Feb 2004 12:48:57 -0500

%% <address@hidden> writes:

  >>> any other special character that would cause make to kick the command to
  >>> the slow path?

  k> BTW Solaris /bin/test is a shellscript which is merly `basename $0`
  k> "$@" so on platforms like this, the slow path (sh -c test) should
  k> be faster.

Why faster?  This means make invokes a shell, which invokes a shell,
which invokes basename.

The fast path invokes a shell, which invokes basename.

  k> Well Linux and *BSD uses binary /bin/test so slow path is slower.
  k> If speed is at premium for bare "test", you can detect the
  k> shellscriptness of the /bin/test and switch accordingly in the
  k> configure (which is a mess, and doesn't gain much anyway, as bare
  k> "test" is rare)

Speed isn't a premium for bare "test", but over the lifetime of a large
build you can get noticeable savings by avoiding shell invocations where
possible.  A large build without a fast path can involve many thousands
of extra shells being invoked.

It's quite obviously not worth doing anything gross like figuring out
whether the command is "test", whether "test" exists on the PATH, or
whether it's a shell script, or anything like that.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]