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
In ast-open 20121024 on Linux cat uses mmap() as it should be. Thanks Irek _______________________________________________ ast-developers mailing list ast-developers@research.att.com https://mailman.research.att.com/mailman/listinfo/ast-developers