You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Bojan Smojver <bo...@rexursive.com> on 2008/04/24 05:08:07 UTC

Re: Request for inclusion in 1.2.13/.14 or 1.3.0: Win32 file copy efficiency

On Wed, 2008-04-23 at 21:29 +0200, Erik Huelsmann wrote:

> Performance would benefit greatly from using APR_FILE_BUFSIZE, which
> is defined as 4096 bytes.

I'm not sure if someone is planning to address this for Windows, but
BUFSIZ on glibc systems is 8k and Unix systems seem to have it set to
1k.

Maybe we should have a private #define that takes max of
APR_FILE_DEFAULT_BUFSIZE and BUFSIZ and then uses that instead of just
BUFSIZ?

-- 
Bojan


Re: Request for inclusion in 1.2.13/.14 or 1.3.0: Win32 file copy efficiency

Posted by Bojan Smojver <bo...@rexursive.com>.
On Thu, 2008-04-24 at 10:52 +0200, Branko Čibej wrote:
> The copy buffer size should be a different 
> private value.

Feel free to adjust.

Reporter of the bug was happy with 4k - that's how the value was chosen,
a opposed to 512 bytes he'd get on his platform.

-- 
Bojan


Re: Request for inclusion in 1.2.13/.14 or 1.3.0: Win32 file copy efficiency

Posted by Branko Čibej <br...@xbc.nu>.
Bojan Smojver wrote:
> On Thu, 2008-04-24 at 13:08 +1000, Bojan Smojver wrote:
>
>   
>> Maybe we should have a private #define that takes max of
>> APR_FILE_DEFAULT_BUFSIZE and BUFSIZ and then uses that instead of just
>> BUFSIZ?
>>     
>
> For instance...
>   

I'm not very impressed by the idea of using a 4-k buffer size for file 
copies. That's bad for a local disk, and seriously undersized for a 
remote mount. Measurements I'd made in the past on various systems (IIRC 
Mac OS and Windows) showed that the optimum was closer to a megabyte.

And I think its wrong to assume that it's ok if the default buffer size 
for file copying is the same as the default for buffered char- or 
line-oriented file I/O. The copy buffer size should be a different 
private value.

-- Brane

Re: Request for inclusion in 1.2.13/.14 or 1.3.0: Win32 file copy efficiency

Posted by Bojan Smojver <bo...@rexursive.com>.
On Thu, 2008-04-24 at 13:08 +1000, Bojan Smojver wrote:

> Maybe we should have a private #define that takes max of
> APR_FILE_DEFAULT_BUFSIZE and BUFSIZ and then uses that instead of just
> BUFSIZ?

For instance...

-- 
Bojan

Re: Request for inclusion in 1.2.13/.14 or 1.3.0: Win32 file copy efficiency

Posted by Paul Querna <ch...@force-elite.com>.
Bojan Smojver wrote:
> On Wed, 2008-04-23 at 21:29 +0200, Erik Huelsmann wrote:
> 
>> Performance would benefit greatly from using APR_FILE_BUFSIZE, which
>> is defined as 4096 bytes.
> 
> I'm not sure if someone is planning to address this for Windows, but
> BUFSIZ on glibc systems is 8k and Unix systems seem to have it set to
> 1k.
> 
> Maybe we should have a private #define that takes max of
> APR_FILE_DEFAULT_BUFSIZE and BUFSIZ and then uses that instead of just
> BUFSIZ?
> 

+1

-Paul