[erlang-questions] Hint erts to preallocate binary of required size

Max Lapshin max.lapshin@REDACTED
Fri Feb 22 20:09:30 CET 2013

erlyvideo has some problems with creating mpeg-ts from mp4.

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.

Right now it takes about 10 000 microseconds to generate one megabyte of

First problem: how can I understand if process copies these small chunks
into heap or they are still subbinary?

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130222/14381e9a/attachment.htm>

More information about the erlang-questions mailing list