diff options
author | Ivan Zhakov <ivan@apache.org> | 2017-03-02 06:16:20 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2017-03-02 06:16:20 +0000 |
commit | 0e96cf8c2d256c9d5a25ac1541f1a6e9803aa093 (patch) | |
tree | 6da5a06372e8bf08d1bd4b336c820fd173165f8b /memory | |
parent | f15c99127ab80cf5022edd79d5ace34a49125995 (diff) | |
download | apr-0e96cf8c2d256c9d5a25ac1541f1a6e9803aa093.tar.gz |
Win32: Improve apr_file_gets() performance on buffered files by not calling
apr_file_read() on each byte.
The benchmark shows that this makes the function roughly 4 times faster:
4.202 ms -> 1.042 ms (I measured multiple calls for the same test file)
Also see https://svn.apache.org/r65294
* file_io/win32/readwrite.c
(apr_file_read): Factor out the part of this function that handles
reading from buffered files ...
(read_buffered): ...into this new helper.
(apr_file_gets): Use the buffer directly for buffered files, the same
way as in the Unix implementation.
* test/testfile.c
(test_gets, test_gets_buffered): Extend these tests with read-after-EOF
checks.
(test_gets_empty, test_gets_multiline, test_gets_small_buf,
test_gets_ungetc, test_gets_buffered_big): New tests.
(testfile): Run the new tests.
Patch by: Evgeny Kotkov <evgeny.kotkov {at} visualsvn.com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1785072 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
0 files changed, 0 insertions, 0 deletions