On 4/12/15 5:56 PM, Eduardo A. Bustamante López wrote: > Oh, you already have lots of things to do to bother with this :-) > > Anyways, I'll expand them. > > On Fri, Apr 10, 2015 at 04:35:25PM -0400, Chet Ramey wrote: >> On 4/10/15 10:13 AM, Eduardo A. Bustamante López wrote: >> >>> - a faster implementation of the variable lookup code >> >> What does this mean, exactly? Optimizing the existing code paths? (Have at >> it.) Different semantics? Static as opposed to dynamic scoping? > > Yes. I've been using gprof to study the code paths of some basic functions, > and > it seems like it spends quite some time in the find_variable() and related > functions (IIRC, there was an mt_hash or something function taking up some > precious time).
I knew that rang a bell somewhere. mt_hash is a function in the bash malloc library that keeps track of all allocations and deallocations in a table. It's part of the debugging that is enabled when you build from the devel code. It's been well-known for a long time that the debugging code in malloc slows bash down considerably; that's why it's not enabled as part of bash releases. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/