<div dir="ltr">Fred, I haven't found yet any good solution, because I've just read your article.<div><br></div><div>My problem is that I write software that should be used in at least 20 different use cases with different profiles of usage and I have absolutely no control over protocols that are used =)</div>
<div><br></div><div><br></div><div>Most horrible situations are something like accepting 1500 byte packets via UDP multicast. Erlang without special C driver cannot handle this load and I need to write special driver in C to accumulate packets.</div>
<div><br></div><div>Also there are many problems with situations when I cannot use iolists because one protocol needs to be converted to other and it involves very complicated bit parsing with saving intermediate state.</div>
<div><br></div><div><br></div><div>It is definitely clear that on my usecases appending binaries works better than iolists and especially than iolist + reverse. </div><div>I suppose it happens because small binaries are collected faster and gets out of young generation, but it is only a suppose.</div>
<div><br></div><div>I've even written small code in .S to preallocate binary when I can guess size: <a href="https://gist.github.com/maxlapshin/5531424">https://gist.github.com/maxlapshin/5531424</a></div><div><br></div>
<div><br></div></div>