[erlang-questions] constructing binaries question

Bob Ippolito <>
Thu Sep 14 22:38:52 CEST 2006


On 9/14/06, Yariv Sadan <> wrote:
> I think your solution will work for me. The final goal is to send the
> query to a socket, so the structure doesn't matter for pattern
> matching. However, I do have to send the query after it's constructed
> to an intermediate gen_server, which then sends the query to a process
> that owns the socket. I know that sending binary messages involves
> less copying than sending other types of messages, so I'm tempted to
> construct the queries as binaries before sending them anywhere.

You could try using iolist_to_binary before sending the query to the
gen_server, which will create a single binary from  your heterogeneous
list of lists and binaries.

Profiling it first would make sense though. Sounds like you're
worrying too much about problems that you don't have yet.

-bob



More information about the erlang-questions mailing list