There is also one here:
stream_one_file(File file, xb_wstream_file_t *xbfile) { uchar buf[XBSTREAM_BUFFER_SIZE]; size_t bytes;
posix_fadvise(file, 0, 0, POSIX_FADV_SEQUENTIAL);
while ((bytes = my_read(file, buf, XBSTREAM_BUFFER_SIZE, MYF(MY_WME))) > 0) { if (xb_stream_write_data(xbfile, buf, bytes)) { msg("%s: xb_stream_write_data() failed.\n", my_progname); return 1; } posix_fadvise(file, 0, 0, POSIX_FADV_DONTNEED);
} ...... .....
here, it is doing fadvise POSIX_FADV_SEQ which doubles the readahead but in the loop it discards it everytime. It should either do POSIX_FADV_DONTNEED at the end (outside the loop) or use ranges with POSIX_FADV_DONTNEED in the loop.
There is also one here:
stream_ one_file( File file, xb_wstream_file_t *xbfile) BUFFER_ SIZE];
{
uchar buf[XBSTREAM_
size_t bytes;
posix_ fadvise( file, 0, 0, POSIX_FADV_ SEQUENTIAL) ;
while ((bytes = my_read(file, buf, XBSTREAM_ BUFFER_ SIZE, write_data( xbfile, buf, bytes)) { write_data( ) failed.\n",
my_progname) ; fadvise( file, 0, 0, POSIX_FADV_ DONTNEED) ;
MYF(MY_WME))) > 0) {
if (xb_stream_
msg("%s: xb_stream_
return 1;
}
posix_
}
......
.....
here, it is doing fadvise POSIX_FADV_SEQ which doubles the
readahead but in the loop it discards it everytime. It should
either do POSIX_FADV_DONTNEED at the end (outside the loop) or
use ranges with POSIX_FADV_DONTNEED in the loop.