The advantage of binaries is that they take up significantly less memory per character and you can send them to other processes on the same node with no copying. Iolists of binaries are also good to use for IO. <span></span><br>
<br>On Monday, May 7, 2012, Fred Hebert wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Cowboy does accept IOLists. They're very rarely going to <b>not</b>
be the fastest data structure to handle the concatenation strings to
be output, in my experience. I do recommend them for any and all
appending and prepending that needs to be done with web servers,
files, etc.<br>
<br>
On Mon May 7 10:48:19 2012, Wes James wrote:<br>
<blockquote type="cite"><br>
On Mon, May 7, 2012 at 8:18 AM, Paul
Barry<a href="javascript:_e({}, 'cvml', 'paul.james.barry@gmail.com');" target="_blank"><paul.james.barry@gmail.com></a> wrote:<br>
<blockquote type="cite"><br>
I take it that doing it that way is "faster" than string
manipulation<br>
(or is there some other reason for this suggestion)?<br>
</blockquote>
<br>
<br>
Based on some discussion I've seen on the list in the past, I
believe<br>
binary is faster. In my case, I'm using binaries to construct html<br>
chunks as I'm using cowboy, but I think cowboy can also use io
lists,<br>
like Fred mentioned.<br>
<br>
-wes<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="javascript:_e({}, 'cvml', 'erlang-questions@erlang.org');" target="_blank">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></blockquote>
</div>
</blockquote>