[RFC] Make getenv O(1)

Ondřej Bílka neleai@seznam.cz
Fri Oct 18 13:47:00 GMT 2013


On Fri, Oct 18, 2013 at 03:26:04PM +0200, Ondřej Bílka wrote:
> On Fri, Oct 18, 2013 at 04:58:43PM +0400, Alexander Monakov wrote:
> > Hi,
> > 
> > I'm curious about the motivation of this change.  Which programs are expected
> > to benefit from faster repeated getenv queries?  (note that bash overrides
> > getenv and co, so changes in glibc implementation won't affect it)
> > 
> Mostly those that call getenv in hot path. This mostly issue of
> libraries, for example fnmatch checks getenv ("POSIXLY_CORRECT") so you
> get definite slowdonw in following case.
> 
Also when you run mutt after
for I in `seq 1 10000`; do export FOO$I=$I; done
it becomes noticably sluggy.



More information about the Libc-alpha mailing list