zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Good grief!  Thousands of calls to stat()
Date: Sat, 30 Jan 1999 15:18:57 -0800	[thread overview]
Message-ID: <990130151858.ZM18216@candle.brasslantern.com> (raw)
In-Reply-To: <990130134019.ZM16947@candle.brasslantern.com>

On Jan 30,  1:40pm, Bart Schaefer wrote:
} Subject: Good grief!  Thousands of calls to stat()
}
} first system call after entering createparamtable() is the brk() to allocate
} the space, and it finally surfaces 4130 system calls later, nearly all of
} which are stat("/dev/somethingorother").

I've traced this to the call to getlogin() when initializing the value of
the LOGNAME variable.  It appears to happen only when some or all of stdin,
stdout, and stderr are redirected away from the terminal (the more of them
that are redirected, the worse it gets).

Although this doesn't have much effect on interactive shells, it probably
causes the startup time of some zsh scripts to be significantly longer
than the same script running under some other shell.

Any suggestions what we could do about it?  How about, trust the username
obtained from getpwuid(), which is what happens in this case anyway after
getlogin() finally gives up?

} There's even a call to ioctl(0, TIOCGWINSZ, ...)

That one happens when TERM is imported from the environment, so it must
be something internal to tgetent() via init_term() via termsetfn().  This
is another thing that probably shouldn't happen when the shell is not an
interactive one.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


      reply	other threads:[~1999-01-30 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-30 21:40 Bart Schaefer
1999-01-30 23:18 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=990130151858.ZM18216@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).