On Fri, 26 Oct 2012 16:57:27 +0200 Roland Mainz wrote: > 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 ? the problem is not insurmountable its just that in pre-libcmd-builtin days ksh regined supreme over sfstdin,sfstdout,sfstderr and at times this clashes with builtins wanting to do the same streams sfopen()'d by builtins are not a problem dgk knows what needs to be done but we've already changed enough for the next alpha (and are still debugging some of those changes before posting)
_______________________________________________ ast-developers mailing list ast-developers@research.att.com https://mailman.research.att.com/mailman/listinfo/ast-developers