You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jens Alfke <je...@mooseyard.com> on 2009/02/26 18:34:21 UTC

Is it possible to replace SpiderMonkey?

How hard would it be to plug a different JavaScript engine into  
CouchDB? Nothing against SpiderMonkey, but the new generation of JS  
engines are a whole lot faster. I've got Google's V8 built as a  
command-line tool; would it be possible to use it in CouchDB?

(I'm not even sure whether CouchDB runs any JS in-process or  
outsources it all to an external process.)

—Jens

Re: Is it possible to replace SpiderMonkey?

Posted by Jan Lehnardt <ja...@apache.org>.
Hi Jens,

On 26 Feb 2009, at 18:34, Jens Alfke wrote:

> How hard would it be to plug a different JavaScript engine into  
> CouchDB? Nothing against SpiderMonkey, but the new generation of JS  
> engines are a whole lot faster. I've got Google's V8 built as a  
> command-line tool; would it be possible to use it in CouchDB?

I tried TraceMonkey when it came out and it was not too hard to swap  
out.

> (I'm not even sure whether CouchDB runs any JS in-process or  
> outsources it all to an external process.)

It's all external.

See your default.ini file:

[query_servers]
javascript = /path/to/couchjs /path/to/couchdb/server/main.js

You need a binary that can run main.js and place it into the above  
directive.

That's it.

Let us know what you find out! :)

Cheers
Jan
--


Re: Is it possible to replace SpiderMonkey?

Posted by Chris Anderson <jc...@apache.org>.
On Thu, Feb 26, 2009 at 10:23 AM, Jens Alfke <je...@mooseyard.com> wrote:
>
>> And also be careful, because as far as i know v8 do not implement E4X
>
> Oops. Wasn't aware that CouchDB depended on that. I don't know if Google has
> plans to implement it, and Apple's SquirrelFish probably won't either (since
> WebKit has never supported E4X.) That leaves TraceMonkey, I guess.
>

I doesn't depend on it, but your views could, if you made a habit of
using e4x. There are one or two tests that will fail without it, but
Couch should basically work without it.



-- 
Chris Anderson
http://jchris.mfdz.com

Re: Is it possible to replace SpiderMonkey?

Posted by Jens Alfke <je...@mooseyard.com>.
On Feb 26, 2009, at 9:39 AM, Paul Davis wrote:

> Is your runner on github to take a look at?

Oh, it's not my own; if you build V8 from its Google Code SVN repo,  
there's a 'v8' binary that lets you run scripts from the command line.


> And also be careful, because as far as i know v8 do not implement E4X

Oops. Wasn't aware that CouchDB depended on that. I don't know if  
Google has plans to implement it, and Apple's SquirrelFish probably  
won't either (since WebKit has never supported E4X.) That leaves  
TraceMonkey, I guess.

—Jens

Re: Is it possible to replace SpiderMonkey?

Posted by Patrick Antivackis <pa...@gmail.com>.
And also be careful, because as far as i know v8 do not implement E4X

2009/2/26 Jan Lehnardt <ja...@apache.org>

>
> On 26 Feb 2009, at 18:39, Paul Davis wrote:
>
>  If you've got a working build of something, it shouldn't be overly
>> difficult. couchjs.c has a very few extra funcitons defined that you
>> should be able to mimic quite easily.
>>
>> The hardest part would be the curl integration, but with the examples
>> even that shouldn't be too bad.
>>
>
> Curl is only needed for the CLI tests. CouchDB should run fine without
> that.
>
>
>
>
>> Is your runner on github to take a look at?
>>
>> Paul
>>
>> On Thu, Feb 26, 2009 at 12:34 PM, Jens Alfke <je...@mooseyard.com> wrote:
>>
>>> How hard would it be to plug a different JavaScript engine into CouchDB?
>>> Nothing against SpiderMonkey, but the new generation of JS engines are a
>>> whole lot faster. I've got Google's V8 built as a command-line tool;
>>> would
>>> it be possible to use it in CouchDB?
>>>
>>> (I'm not even sure whether CouchDB runs any JS in-process or outsources
>>> it
>>> all to an external process.)
>>>
>>> —Jens
>>>
>>
>>
>

Re: Is it possible to replace SpiderMonkey?

Posted by Jan Lehnardt <ja...@apache.org>.
On 26 Feb 2009, at 18:39, Paul Davis wrote:

> If you've got a working build of something, it shouldn't be overly
> difficult. couchjs.c has a very few extra funcitons defined that you
> should be able to mimic quite easily.
>
> The hardest part would be the curl integration, but with the examples
> even that shouldn't be too bad.

Curl is only needed for the CLI tests. CouchDB should run fine without
that.


>
> Is your runner on github to take a look at?
>
> Paul
>
> On Thu, Feb 26, 2009 at 12:34 PM, Jens Alfke <je...@mooseyard.com>  
> wrote:
>> How hard would it be to plug a different JavaScript engine into  
>> CouchDB?
>> Nothing against SpiderMonkey, but the new generation of JS engines  
>> are a
>> whole lot faster. I've got Google's V8 built as a command-line  
>> tool; would
>> it be possible to use it in CouchDB?
>>
>> (I'm not even sure whether CouchDB runs any JS in-process or  
>> outsources it
>> all to an external process.)
>>
>> —Jens
>


Re: Is it possible to replace SpiderMonkey?

Posted by Paul Davis <pa...@gmail.com>.
If you've got a working build of something, it shouldn't be overly
difficult. couchjs.c has a very few extra funcitons defined that you
should be able to mimic quite easily.

The hardest part would be the curl integration, but with the examples
even that shouldn't be too bad.

Is your runner on github to take a look at?

Paul

On Thu, Feb 26, 2009 at 12:34 PM, Jens Alfke <je...@mooseyard.com> wrote:
> How hard would it be to plug a different JavaScript engine into CouchDB?
> Nothing against SpiderMonkey, but the new generation of JS engines are a
> whole lot faster. I've got Google's V8 built as a command-line tool; would
> it be possible to use it in CouchDB?
>
> (I'm not even sure whether CouchDB runs any JS in-process or outsources it
> all to an external process.)
>
> —Jens