Ola!,

You are rigth with the buffering effect, however...

I made the following experiments on a HPUX machine this time. (Do not
have acces to the other one at the momont)

1. made a copy of the 600MB file, and indeed first reading takes
longer with vim:
first reading:
XXXX>time vim --noplugin -u ./.vimrc XXXXXXX/tmp/cucu.bebe -c":q"
39.07s real    26.18s user    10.72s system
second reading:
XXXX>time vim --noplugin -u ./.vimrc XXXXXXX/tmp/cucu.bebe -c":q"
33.13s real    25.27s user     7.29s system

2. made again another copy, and this time reading with my smal
program:
first reading:
time ./load  XXXXX/tmp/cucu.bebe 10000
total read 67706*10000=677060000    1.28s real     0.03s user
1.23s system

second reading
XXXX>time ./load  XXXX/tmp/cucu.bebe 10000
total read 67706*10000=677060000    1.25s real     0.04s user
1.21s system


with grep
first:
XXXX>time gr XXXXXXXXXXXXXXXXXXX   XXXXX/tmp/cucu.bebe
    1.44s real     0.28s user     1.10s system
second:
   1.41s real     0.29s user     1.09s system

and again vim:

XXXX>time vim --noplugin -u ./.vimrc XXXXXXX/tmp/cucu.bebe -c":q"
   41.77s real    26.25s user    10.81s system


So, in conclusion, the buffer effect is there, but is not significant.
Vim spends for some reason 10 times more in kernel for simple reading.
And a lot in userspace. I understand that it takes time to build the
data structure for the internal representation of the text, but I have
the feeling that there is space for optimization. I would be happy to
help, if the owner of the project gives some signes...

VIM IS THE BEST EDITOR

Misi











On Jun 17, 9:32 am, "Antonio Colombo" <[EMAIL PROTECTED]> wrote:
> Hi misi,
>
> > you almost convinced me with the disk time...
>
> > but that is not true. Reading the same file with a command like grep,
> > takes 567msecs.
> > try
>
> > time grep XXXXXXXXXXX ./all3.c #this will not find anything, but will
> > process all the file.. and no mmap is used!!!!!
> > the result is:
>
> The problem with "the time it takes to read" in Unix is elusive.
> It depends on the number of real physical reads Unix has to do.
> If the data is already in the buffers, the performance is much better.
> Example (with a 27MB file I had not been using in advance):
>
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m1.342s
> user 0m0.028s
> sys 0m0.048s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.093s
> user 0m0.040s
> sys 0m0.024s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.088s
> user 0m0.028s
> sys 0m0.036s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.082s
> user 0m0.032s
> sys 0m0.028s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.062s
> user 0m0.016s
> sys 0m0.028s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.055s
> user 0m0.024s
> sys 0m0.020s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.077s
> user 0m0.024s
> sys 0m0.036s
> (aca) root /e/ita > time grep zxdfgghjjkk voci.txt
>
> real 0m0.049s
> user 0m0.020s
> sys 0m0.024s
> (aca) root /e/ita > ll voci.txt
> -rwxrwxr-x 1 root users 27338279 15 mag 2007 voci.txt
>
> I don't know in which conditions you performed your tests,
> but ideally you should reboot once per each test, and
> perform the test without having used the file in advance,
> in order to be sure that the Unix buffers are empty (of
> the tested file).
>
> Then a comparison can be safely used.
>
> Cheers, Antonio
> --
>    /||\    | Antonio Colombo
>   / || \   | [EMAIL PROTECTED]
> /  ()  \  | [EMAIL PROTECTED]
> (___||___) |   [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui