Re: Possible eval builtin speedup?

2008-03-12 Thread Chet Ramey
> > > What is the role of xmbsrtowcs? Why doesn't mbsrtowcs convert 0x5c to > > U<0x5c>? > > > > > > I see. I assume that it's a bug in mbsrtowcs. (If you check, xmbsrtowcs > > isn't used anywhere, so the question is moot.) > > Ok. But I suppose that the role of xdupmbsrtowcs is to avoid the

Re: Possible eval builtin speedup?

2008-03-12 Thread Nicolas
> > What is the role of xmbsrtowcs? Why doesn't mbsrtowcs convert 0x5c to > U<0x5c>? > > > I see. I assume that it's a bug in mbsrtowcs. (If you check, xmbsrtowcs > isn't used anywhere, so the question is moot.) Ok. But I suppose that the role of xdupmbsrtowcs is to avoid the same bug, am I r

Re: Possible eval builtin speedup?

2008-03-10 Thread Chet Ramey
Nicolas wrote: I don't really understand this question. What is the role of xmbsrtowcs? Why doesn't mbsrtowcs convert 0x5c to U<0x5c>? I see. I assume that it's a bug in mbsrtowcs. (If you check, xmbsrtowcs isn't used anywhere, so the question is moot.) Chet -- ``The lyf so short, the c

Re: Possible eval builtin speedup?

2008-03-10 Thread Andreas Schwab
Nicolas <[EMAIL PROTECTED]> writes: > What is the role of xmbsrtowcs? Why doesn't mbsrtowcs convert 0x5c to U<0x5c>? SHIFT-JIS defines 0x5c to be the Yen sign . Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key f

Re: Possible eval builtin speedup?

2008-03-10 Thread Nicolas
Thanks for your answer. > > Nevertheless, I don't really understand the purpose of this function. > > Is it supposed to bypass a bug in mbsrtowcs (defined in wchar.h), as > > said in the following commentaries? > > /* xmbsrtowcs.c -- replacement function for mbsrtowcs */ > > /* On some locale

Re: Possible eval builtin speedup?

2008-03-10 Thread Chet Ramey
Nicolas wrote: Jan Schampera wrote: Yea, I didn't look close enough. My fault. Ok, I found the problem: xdupmbstowcs (in file /lib/glob/xmbsrtowcs.c) is painfully slow, because of very frequent calls to realloc. I think this could be optimized. You're probably right, and I see at least one w

Re: Possible eval builtin speedup?

2008-03-10 Thread Nicolas
Jan Schampera wrote: > Yea, I didn't look close enough. My fault. Ok, I found the problem: xdupmbstowcs (in file /lib/glob/xmbsrtowcs.c) is painfully slow, because of very frequent calls to realloc. I think this could be optimized. Nevertheless, I don't really understand the purpose of this funct

Re: Possible eval builtin speedup?

2008-03-07 Thread Jan Schampera
Nicolas Bonifas wrote: > Thanks for your answer. > >> 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? > > How does it explain the speed difference between "echo `dircolors`" > and "dircol

Re: Possible eval builtin speedup?

2008-03-07 Thread Andreas Schwab
"Nicolas Bonifas" <[EMAIL PROTECTED]> writes: > Bash starts slowly on my 600 Mhz computer (.62 seconds). I wanted to > understand why, and here is what I found: > > $ time eval `dircolors` This has nothing to do with eval, the command is underquoted. You are measuring the time it takes to apply

Re: Possible eval builtin speedup?

2008-03-07 Thread Nicolas Bonifas
Thanks for your answer. > 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? How does it explain the speed difference between "echo `dircolors`" and "dircolors" ?

Re: Possible eval builtin speedup?

2008-03-06 Thread Jan Schampera
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 i

Re: Possible eval builtin speedup?

2008-03-06 Thread Nicolas Bonifas
> > 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: $ tim

Re: Possible eval builtin speedup?

2008-03-05 Thread Chris F.A. Johnson
On 2008-03-02, Nicolas Bonifas wrote: > Hi, > Bash starts slowly on my 600 Mhz computer (.62 seconds). I wanted to > understand why, and here is what I found: > > $ time eval `dircolors` > > real0m0.325s > user0m0.316s > sys 0m0.004s > > I wanted to know what is so slow in the previous

Possible eval builtin speedup?

2008-03-02 Thread Nicolas Bonifas
Hi, Bash starts slowly on my 600 Mhz computer (.62 seconds). I wanted to understand why, and here is what I found: $ time eval `dircolors` real0m0.325s user0m0.316s sys 0m0.004s I wanted to know what is so slow in the previous command, so here is another test: $ time (dircolors > di