Friday, August 23, 2019

Re: increasing default read size? & using direct read?

> I was noticing that it took a LONG time to read in a 606.9MB file in
> a "local" gvim session (local meaning gvim running on same machine
> as file is located).
>
> I finally figured that it was reading 64KB at a time
> using async reads.
>
> That is really slow compared to using a direct
> read of say, 16M at a time....
>
> I.e. using the async reads, for a 8M file takes 2.14s.
> It averages 4MB/s,
>
> Using a direct read of 16M/read takes .18s averaging 3.5GB/s.
>
> Is there anyway to speed up vim's reading of large files?

Vim is optimized for text files, which are usually not that big.

Besides Reading Vim does other things, such as splitting the text into
lines, checking encoding, etc. And the text has to be copied into data
blocks. The actual read might not be the most important thing, it
requires profiling and perhaps trying out some changes to see what the
effect of a bigger buffer really is.

One thing that has been on the todo list for a very long time is to
avoid the extra copy, but reversing the way text is stored in data
blocks. But that is complicated...

--
hundred-and-one symptoms of being an internet addict:
102. When filling out your driver's license application, you give
your IP address.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/201908231913.x7NJDGvA002288%40masaka.moolenaar.net.

No comments: