incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: Erlang vs JavaScript
Date Wed, 14 Aug 2013 23:12:31 GMT

On Aug 14, 2013, at 1:57 PM, Filippo Fadda <filippo.fadda@programmazione.it> wrote:

> The bottleneck is not the language used to write the Query Server, but it's the standard
input/output used for inter-process communication.

That’s basically what I’m saying, if you include the JSON marshaling in the stdio overhead.

> Why not use 0MQ instead?

Why would that be faster? Presumably it’s still marshaling the data in some form and sending
it to another process over pipes or sockets. (But if it’s using something fancy like shared-memory
buffers to do the IPC, that would indeed be better.)

If you use an in-process JSVM you can directly traverse the Erlang term and construct a corresponding
JS object in memory without going through any intermediate representation like JSON; that’s
a lot faster. (Our old iErl repo from Couchbase Mobile has code for doing this with SpiderMonkey.)

—Jens
Mime
View raw message