zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: stream buffering
Date: Fri, 18 Feb 2011 20:55:51 +0000	[thread overview]
Message-ID: <20110218205551.61fb9fb4@pws-pc.ntlworld.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1102171938510.16574@MyComp2.rgm-web.net>

On Thu, 17 Feb 2011 19:40:20 -0600 (CST)
Rory Mulvaney <rorymulv@gmail.com> wrote:
> I'm wondering if the reason that some I/O intensive zsh shell scripts 
> aren't fast is mostly only because the I/O is (I think) line-buffered. 
> Is there a way to do full buffering of streams, or what would be the best 
> way to provide it?  Maybe a module similar to zsh/net/socket, perhaps 
> using setvbuf(3)?

What I/O are you referring to?  The shell's own input for a script needs
to be parsed and intepreted, which will be much more of a restriction
than buffering except for scripts with really silly amounts of embedded
text like here documents.  Standard input to the shell via the read
builtin etc. similarly tends to be in short chunks, likewise output via
print.  Input to other commands run from scripts makes its own
arrangements for buffering.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2011-02-18 21:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18  1:40 Rory Mulvaney
2011-02-18 20:55 ` Peter Stephenson [this message]
     [not found] <alpine.DEB.2.00.1102181746060.22551@MyComp.rgm-web.net>
2011-02-18 23:56 ` Rory Mulvaney
2011-02-21 10:08   ` Peter Stephenson

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=20110218205551.61fb9fb4@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@zsh.org \
    /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).