On Fri, Apr 1, 2016 at 11:09 AM, yary <not....@gmail.com> wrote:

> Setting the buffer size is better done by the user, not the
> programmer. Often the user and the programmer are one and the same, in
> which case, the programmer knows the environment and can set the
> environment variables- or change the code- whichever makes better
> sense.


I would disagree with this; having been in both of those seats,

(a) the correct buffer size is often per file, not per program/invocation,
so a one-size-fits-all envar is the wrong approach;

(b) it is rare for the buffer size to be different based on the system
except on systems so small that rakudo isn't going to work on them anyway
(e.g. embedded systems).

64k is a rather large buffer size relative to libc stdio which is usually
4-8k, but rather small compared to many other aspects of rakudo's memory
usage. I can't see this impacting much in the common case. In the specific
case that prompted this thread, it is the programmer that wants to specify
a very large buffer. And the fact that a very large buffer is wanted is
actually a symptom of an even more significant memory issue: is a small
system even going to be able to handle that much data to begin with? So
again, the *buffer size* is not the important part of the equation and
trying to tune it to reduce the impact on the system is attacking the wrong
part of the problem.

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Reply via email to