[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible eval builtin speedup?
From: |
Jan Schampera |
Subject: |
Re: Possible eval builtin speedup? |
Date: |
Fri, 07 Mar 2008 06:05:05 +0100 |
User-agent: |
IceDove 1.5.0.14pre (X11/20080208) |
Nicolas Bonifas wrote:
>> > I don't know much about bash internals, but there is probably room for
>> > a huge performance improvement in speeding up the eval builtin.
>> > What do you think about it? Would it be a difficult task?
>>
>> It is more likely to be the command substitution that is slow.
>
> You're right:
> $ time (echo `dircolors` > /dev/null)
>
> real 0m0.318s
> user 0m0.312s
> sys 0m0.008s
>
> I ran the previous tests with bash-3.1. With bash-3.2, echo
> `dircolors` take 0.088s of user time (1/4th of the time needed by
> bash-3.1), and dircolors > dircolors_output && sh ./dircolors_output
> still takes 0.004s, so it is more than 20 times faster than using
> command substitution.
>
> So, do you think that speeding up command substitution would be a
> difficult task?
I assume you know that the speed issues most likely come from the
operating system's supporting functions like the fork() and exec*()
family members? Executing another process takes time and there is not
much you can do about it.
If you have speed problems while using a huge amount of command
substitutions you either have a bad script design or use the wrong
language for your specific task IMHO.
J.
- Possible eval builtin speedup?, Nicolas Bonifas, 2008/03/02
- Re: Possible eval builtin speedup?, Chris F.A. Johnson, 2008/03/05
- Re: Possible eval builtin speedup?, Nicolas Bonifas, 2008/03/06
- Message not available
- Re: Possible eval builtin speedup?,
Jan Schampera <=
- Re: Possible eval builtin speedup?, Nicolas Bonifas, 2008/03/07
- Message not available
- Re: Possible eval builtin speedup?, Jan Schampera, 2008/03/07
- Re: Possible eval builtin speedup?, Nicolas, 2008/03/10
- Re: Possible eval builtin speedup?, Chet Ramey, 2008/03/10
- Re: Possible eval builtin speedup?, Nicolas, 2008/03/10
- Re: Possible eval builtin speedup?, Andreas Schwab, 2008/03/10
- Re: Possible eval builtin speedup?, Chet Ramey, 2008/03/10
- Re: Possible eval builtin speedup?, Nicolas, 2008/03/12
- Re: Possible eval builtin speedup?, Chet Ramey, 2008/03/12