<div dir="ltr">I'm collecting now iolists and it takes a lot of time.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 11:18 PM, Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com" target="_blank">dmkolesnikov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Max,<br>
<div class="im"><br>
> First problem: how can I understand if process copies these small chunks into heap or they are still subbinary?<br>
<br>
</div><a href="http://erldocs.com/R14B02/stdlib/binary.html?i=25&search=binary:#referenced_byte_size/1" target="_blank">http://erldocs.com/R14B02/stdlib/binary.html?i=25&search=binary:#referenced_byte_size/1</a><br>
<div class="im"><br>
> Second idea: can it be a good idea to tell erts that I want to allocate new binary of 140 kbytes size and append small chunks to it with only one copying?<br>
<br>
</div>May be you should use iolist instead of binary?<br>
<br>
- Dmitry<br>
<div><div class="h5"><br>
On Feb 22, 2013, at 9:09 PM, Max Lapshin <<a href="mailto:max.lapshin@gmail.com">max.lapshin@gmail.com</a>> wrote:<br>
<br>
> erlyvideo has some problems with creating mpeg-ts from mp4.<br>
><br>
> Problem is following: mp4 stores video frames in continuos blocks of 100 kbytes. MPEG-TS requires to split this 100 kbytes into small chunks of about 180 bytes each.<br>
><br>
> Right now it takes about 10 000 microseconds to generate one megabyte of mpeg-ts.<br>
><br>
> First problem: how can I understand if process copies these small chunks into heap or they are still subbinary?<br>
><br>
><br>
> Second idea: can it be a good idea to tell erts that I want to allocate new binary of 140 kbytes size and append small chunks to it with only one copying?<br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div>