From: "mame (Yusuke Endoh)" Date: 2012-11-24T11:48:00+09:00 Subject: [ruby-core:49982] [ruby-trunk - Feature #6047] read_all: Grow buffer exponentially in generic case Issue #6047 has been updated by mame (Yusuke Endoh). Target version changed from 2.0.0 to next minor My experience also shows that it is useless to open a ticket for a reminder to myself :-) I'm setting to next minor tentatively, but if it is really just a performance improvement (i.e., it affects no external modules), you can commit it to 2.0.0 before code freeze. -- Yusuke Endoh ---------------------------------------- Feature #6047: read_all: Grow buffer exponentially in generic case https://bugs.ruby-lang.org/issues/6047#change-33749 Author: MartinBosslet (Martin Bosslet) Status: Assigned Priority: Normal Assignee: MartinBosslet (Martin Bosslet) Category: core Target version: next minor In the general case, read_all grows its buffer linearly by just the amount that is currently read from the underlying source. This results in a linear number of reallocs, It might turn out beneficial if the buffer were grown exponentially by multiplying with a constant factor (e.g. 1.5 or 2), thus resulting in only a logarithmic numver of reallocs. I will provide a patch and benchmarks, but I'm already opening this issue so I won't forget. See also https://bugs.ruby-lang.org/issues/5353 for more details. -- http://bugs.ruby-lang.org/