1

I am writing a list function in couchDB. I want to know if using a faster language than javascript would boost performance (i was thinking python, just because I know it).

Does anyone know if this is true, and has anyone tested whether it is true?

ddouglascarr
  • 1,334
  • 3
  • 14
  • 23
  • http://stackoverflow.com/questions/5168718/what-blocks-ruby-python-to-get-javascript-v8-speed Although CouchDB does not use V8, but Spider Monkey, I do not think that Mozilla guys stay behind in the race between the browsers :) – Marcin Skórzewski Mar 15 '13 at 07:09

2 Answers2

1

Generally the different view engines are going to give you the same speed.

Except erlang, which is much faster.

The reason for this is that erlang is what CouchDB is written in and for all other languages the data needs to get converted into standard JSON then sent to the view server, then converted back to the native erlang format for writing.

BUT, This performance "boost" only happens on view generation, which typically happens out -of-line of a request or only on the changed documents.

As in, real world usage performance difference between view servers is irrelevant most of the time.

Here is the list of all the view server implementations: http://wiki.apache.org/couchdb/View_server

I've never used the python ones, but if that is where you are comfortable, go for it.

Simon
  • 521
  • 2
  • 9
  • thanks for that. Of particular concern for me is the _list function, which is run every time it's queried, on the data returned by a view. Looks like I might be learning erlang. – ddouglascarr Mar 31 '13 at 02:34
  • From watching the CouchDB lists its only worth writing _list functions (in erlang or not) for things that are pretty straight forward. If you are doing complex filtering/display it is probably better to do it on the applications that is doing the rest of the work. (unless you don't have one...) – Simon Mar 31 '13 at 19:56
0

You can use the V8 engine if you want for Couch. A guy from IrisCouch wrote couchjs to do this (I've seen him on Stack Overflow quite a bit too).

https://github.com/iriscouch/couchjs

Also for views, filtered replication, things like that, you can write the functions in Erlang instead of javascript. I've done that and seen around a 50% performance increase.

Seems you can write list functions in Erlang: http://tisba.de/2010/11/25/native-list-functions-with-couchdb/

ryan1234
  • 7,237
  • 6
  • 25
  • 36