The shell may have some particular thing about sfstdin but from Sfio
alone, the problem with mmap and read streams is independent of whether
or not the stream is sfstdin. It's an iffe test for performance written
back in the 1980's that is no longer applicable on modern machines.
That has been fixed.

> From ast-developers-boun...@research.att.com Fri Oct 26 10:57:30 2012
> To: Glenn Fowler <g...@research.att.com>
> Cc: ast-developers@research.att.com
> Subject: Re: [ast-developers] sfio mmap() read support broken?

> On Wed, Oct 24, 2012 at 7:07 PM, Glenn Fowler <g...@research.att.com> wrote:
> > On Sat, 20 Oct 2012 19:53:46 +0200 Cedric Blancher wrote:
> >> On 19 October 2012 03:29, ÏÌØÇÁ ËÒÙÖÁÎÏ×ÓËÁÑ
> >> <olga.kryzhanov...@gmail.com> wrote:
> >> > Glenn, David, Suse 12.2, with ast-ksh.20121016 command substitutions
> >> > still use read() to read data instead of mmap(), as you can see with
> >> > this tests:
> >> > strace ~/bin/ksh -c 'x=$(seq 400000) ; true' 2>&1 | fgrep 'read(' | wc -l
> >> > 50
> >> > strace ~/bin/ksh -c 'x=$(seq 800000) ; true' 2>&1 | fgrep 'read(' | wc -l
> >> > 92
> >> > strace ~/bin/ksh -c 'x=$(seq 1600000) ; true' 2>&1 | fgrep 'read(' | wc 
> >> > -l
> >> > 187
> >> >
> >> > The builtin cat command does not use mmap() either, as you can see in
> >> > this tests:
> >> > strace ~/bin/ksh -c 'builtin cat ; builtin rm ; seq 1600000 >s1 ; cat
> >> > s1 >s2 ; rm s1 s2' 2>&1 | fgrep 'read(' | wc -l
> >> > 187
> >> > strace ~/bin/ksh -c 'builtin cat ; builtin rm ; seq 3200000 >s1 ; cat
> >> > s1 >s2 ; rm s1 s2' 2>&1 | fgrep 'read(' | wc -l
> >> > 382
> >> > strace ~/bin/ksh -c 'builtin cat ; builtin rm ; seq 6400000 >s1 ; cat
> >> > s1 >s2 ; rm s1 s2' 2>&1 | fgrep 'read(' | wc -l
> >> > 773
> >> >
> >> > On Solaris, the Sun /usr/bin/cat uses mmap(), and for this reason, out
> >> > runs AST cat, even the libcmd built in version, by a factor of 1.9-2.7
> >> > for files larger than 10MB.
> >
> >> David, Glenn, can you try to fix this for the next alpha, please? It
> >> seems this has a larger performance impact for large datasets on busy
> >> systems (i.e. "big data) and send the patch for ast-ksh 2012-10-16 to
> >> me (and anyone else interested, too)
> >
> > the next alpha will have this working in builtins for sfio input streams
> > other than sfstdin -- a bit more design is needed to handle sfstdin

> Erm... just curious: sfstdin from pipe can't be |mmap()|'ed in any
> sane or mad way... but what is the problem if sfstdin points to a
> normal, plain file ?

> ----

> Bye,
> Roland

> -- 
>   __ .  . __
>  (o.\ \/ /.o) roland.ma...@nrubsig.org
>   \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
>   /O /==\ O\  TEL +49 641 3992797
>  (;O/ \/ \O;)
> _______________________________________________
> ast-developers mailing list
> ast-developers@research.att.com
> https://mailman.research.att.com/mailman/listinfo/ast-developers

_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to