You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ivan Zhakov <iv...@visualsvn.com> on 2017/03/02 06:18:35 UTC
Re: [PATCH] Optimize apr_file_gets() for buffered files on Windows
On 4 February 2017 at 21:40, Evgeny Kotkov <ev...@visualsvn.com> wrote:
> Hi everyone,
>
> The Unix implementation of apr_file_gets() features an optimization
> for buffered files that avoids calling apr_file_read() / memcpy() for
> one byte, and directly uses the buffered data. This optimization was
> added in https://svn.apache.org/r65294
>
> The attached patch implements the same optimization in the Win32 version
> of apr_file_gets(), and extends the corresponding part of the test suite.
>
> This makes the function roughly 4 times faster than before. It is heavily
> used by the Subversion's filesystem layer and various modules in the
> HTTP Server, e.g., mod_negotiation, and these or other existing callers
> would benefit from this optimization.
>
Hi Evgeny,
Thanks for the patch. Committed in r1785072 [1]
PS: apr_file_gets() could be further optimized by using memchr() to
find '\n' in the buffer, but I don't know whether performance
improvement worth the efforts.
https://svn.apache.org/r1785072
--
Ivan Zhakov