in reply to Re: 4k read buffer is too small
in thread 4k read buffer is too small

Thank you, this sounds like what I was looking for. I was poking at the Perl code today. I will try this tomorrow.

PS: Do you think the Perl gods will make a buffer setting function available again in PerlIO? After all, C has setvbuf and C++ has myistream.rdbuf()->pubsetbuf(buf,bufsize) to let the user override defaults, if he so choses.

Replies are listed 'Best First'.
Re^3: 4k read buffer is too small
by almut (Canon) on Jun 17, 2008 at 15:06 UTC
    Do you think the Perl gods will make a buffer setting function available again in PerlIO?

    I can't really speak for the Perl gods, but considering that the configurability of the buffer size currently is near the lowest conceivable level1, I'd think that making it user-settable (à la setvbuf with stdio) isn't prioritized very high at the moment.

    You might want to bring the issue up on p5p, however... if you feel determined and are well prepared with good arguments :) — I do remember having come across a related discussion (last time I felt like needing setvbuf myself), but unfortunately, I can't find it at the moment2. I recall I did sense some reluctance to change in the overall tone of the thread...

    ___

    1 "configurability levels" that I could think of:

    • (1) hardcoded magic constant in the code
    • (2) macro/constant (system-dependent) automatically determined during configure
    • (3) compile-time configure option
    • (4) user-configurable global runtime option affecting all buffers (switch, env-var, magic Perl var, whatever)
    • (5) user-configurable runtime option per IO handle (like setvbuf)
    • (6) user-configurable runtime option per PerlIO layer
    • (7) like (6), but dynamically reconfigurable on open/unflushed handles

    2 googling the p5p archives - i.e. 'setvbuf site:www.xray.mpe.mpg.de' - doesn't produce any hits, although there are definitely some mentions of setvbuf  (presumably some restrictive robots.txt file)

      As always, p5p welcomes well-crafted patches more openly than suggestions without code. The people needing such a configuration point may have to be the ones to put in the effort before it'd be even considered for inclusion.