bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Degraded performance in cat + patch


From: Pádraig Brady
Subject: Re: Degraded performance in cat + patch
Date: Fri, 6 Mar 2009 11:35:11 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Pádraig Brady wrote:
> Jim Meyering wrote:
>> >From 6dd9c564a0cba6eec95102f091c6692a5ab48876 Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <address@hidden>
>> Date: Fri, 6 Mar 2009 10:27:43 +0100
>> Subject: [PATCH] cat: use larger buffer sizes to reduce read/write-syscall 
>> overhead
>>
>> * src/cat.c (max): Remove definition.  Use MAX from system.h instead.
>> (compute_buffer_size): New function.
>> (main): Use it, to compute larger input and output buffer sizes
>> derived from st_blksize, now typically 32KiB rather than 4KiB.
>> Suggestion from Tzvi Rotshtein.
> 
> That sounds like previously cat did not derive from st_blksize
> and that st_blksize is typically 32KiB :) Suggested log message:
> 
> * src/cat.c (max): Remove definition.  Use MAX from system.h instead.
> (compute_buffer_size): New function to compute the input and output
> buffer sizes, which are now set at 8 times st_blksize with
> a minimum of 32KiB. Previously the typical block sizes used were
> 1KiB for pipes and 4KiB for files.
> (main): Use it.
> This was seem to increase throughput by up to 50%.
> Suggestion from Tzvi Rotshtein.

Oops :) accurate one below I think:

* src/cat.c (max): Remove definition.  Use MAX from system.h instead.
(compute_buffer_size): New function to compute the input and output
buffer sizes, which are now set at 8 times st_blksize with a maximum
of 32KiB. Previously the typical block sizes used were 1KiB for pipes
and 4KiB for files, and now will be 8KiB and 32KiB respectively.
(main): Use it.
This was seem to increase throughput by up to 50%.
Suggestion from Tzvi Rotshtein.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]