Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16445
| From | L A Walsh <bash@tlinx.org> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: [PATCH 5.1] zread: read files in 4k chunks |
| Date | 2020-06-23 12:29 -0700 |
| Message-ID | <mailman.342.1592940601.2574.bug-bash@gnu.org> (permalink) |
| References | <20200622055328.155106-1-Jason@zx2c4.com> <3cac1f66-697d-396d-3dc8-fc5b621638a4@case.edu> <271ebec9-fe1f-7823-a236-2e734657a279@iki.fi> <CAHmME9oLN4OiPnthUi1rdRhwkSPchGcyYRdpEyXz4ciU_cBg0Q@mail.gmail.com> <CALOnQv4rX7qQH7HQLH_dA6bAxSh+8KongB_ba0oWNjG=qUDEJQ@mail.gmail.com> |
The 'stat(2)' system call returns an optimal i/o size for files since some files in addition to being on disks with a 4k sector size (making 128bytes a slow choice for reads, and a real slow choice for writes), also can be on a RAID with it's own optimal i/o size. I think the 'stat(1)' prog shows the same value with "%o": "stat -c%o" . 65536 On Mon, Jun 22, 2020 at 1:19 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote: > On Mon, Jun 22, 2020 at 2:16 PM Ilkka Virta <itvirta@iki.fi> wrote: > > > > On 22.6. 19.35, Chet Ramey wrote: > > > On 6/22/20 1:53 AM, Jason A. Donenfeld wrote: > > >> Currently a static sized buffer is used for reading files. At the > moment > > >> it is extremely small, making parsing of large files extremely slow. > > >> Increase this to 4k for improved performance. > > > > > > I bumped it up to 1024 initially for testing. > > > > It always struck me as odd that Bash used such a small read of 128 > > bytes. Most of the GNU utils I've looked at on Debian use 8192, and a > > simple test program seems to indicate glibc's stdio reads 4096 bytes at > > one read() call. > > Plus most other shells people use... > >
Back to gnu.bash.bug | Previous | Next | Find similar
Re: [PATCH 5.1] zread: read files in 4k chunks L A Walsh <bash@tlinx.org> - 2020-06-23 12:29 -0700
csiph-web