autoconf
[Top][All Lists]
Advanced

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

Re: Severe performance problem and proposed solution


From: Paul Eggert
Subject: Re: Severe performance problem and proposed solution
Date: Tue, 26 Feb 2002 16:56:10 -0800 (PST)

> From: Zack Weinberg <address@hidden>
> Date: Tue, 26 Feb 2002 08:37:08 -0800
> 
> According to David Edelsohn <address@hidden>, AIX's /bin/sh and
> /bin/ksh support $LINENO but have the same performance problem with
> here documents.  That means the _test_ as implemented is not good
> enough.  It may be possible to detect the problem and add a check for
> it to the probe logic

I thought about it a bit, but I don't see how to do this portably,
using just shell commands.

Can you assume that the people with the performance problems have
access to a better shell like Bash?  If so, you can ask them to put
CONFIG_SHELL=/path/to/bash before running configure.  That should
solve the problem.  If they don't have access to such a shell, then
I'm afraid the only solution that suggests itself is to rewrite the
script to avoid the performance problem.

For example, you might try using 'case' rather than 'if'.  Sometimes
that avoids weird performance bugs in /bin/sh.  E.g. instead of:

   if test -n "$with_cross_host" || test x"$build" != x"$host"; then
     [huge code A]
   else
     [huge code B]
   fi

you do this:

   if "$with_cross_host" || test x"$build" != x"$host"
   then cross_compiling=1
   else cross_compiling=0
   fi
   case $cross_compiling in
   1) [huge code A];;
   0) [huge code B];;
   esac

Another possibility is to put the huge code fragments into subsidiary
shell scripts.

Or you could break them into small pieces, each protected by an
independent test.  Admittedly this will be a bit more painful.  For
example, instead of this:

  if test -n "$with_cross_host" || test x"$build" != x"$host"; then
    GLIBCPP_CHECK_COMPILER_FEATURES
    GLIBCPP_CHECK_LINKER_FEATURES
  fi

you do this:

  if test -n "$with_cross_host" || test x"$build" != x"$host"; then
    GLIBCPP_CHECK_COMPILER_FEATURES
  fi
  if test -n "$with_cross_host" || test x"$build" != x"$host"; then
    GLIBCPP_CHECK_LINKER_FEATURES
  fi



reply via email to

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