1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

各言語 i/o buffer相当のデフォルトサイズ

Last updated at Posted at 2025-11-02
標準サイズ 全体の動的変更 補足
Python 3.14 8kb 不可
Python 3.15 128kb 不可 増加予定
*Node.js 22
(とbun)
64kb / objectmodeなら16個 setDefaultHighWaterMark()
Rust 8kb 不可
Ruby 64kb env RUBY_IO_BUFFER_DEFAULT_SIZE

* highwatermarkであり流量制御用。実際はi/oバッファではない

全体的に、大きめのファイル操作を想定するとまだまだ上げてもよさそうな数値帯です
もちろん組み込みは別ですし1アプリサーバあたりの並列処理量やレイテンシによっても変わってくるでしょう

どの言語でも開くときにbuffer size相当を自分で設定可能です。
ただ毎回設定するのは手間がかかりますね

Python

max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)でもある

デフォルトが一番大きくなる予定

Node.js

あくまでもhighwatermarkです

Rust

https://doc.rust-lang.org/std/io/struct.BufReader.html
一番小さいが組み込みなど想定か

Ruby

環境変数で変更できるため自分のプログラム以外でも変更できるのは嬉しい

注意事項

バッファにも形式があったり、ライブラリによって別の設定入れたりそもそも通過しなかったりと様々です。
デフォルト設定が変わっても必ずしも性能に影響があるとは限りません

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?