couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCaffrey" <mmccaff...@ittvis.com>
Subject RE: Erlag View performance
Date Tue, 09 Mar 2010 20:31:20 GMT
I'm doing a straight lists:foldl call on one of the fields in the
document.

I've done some timings and the time is all in the fold function. The
call into the view for each document and the emit is insignificant.

So it doesn't seem to be the i/o of the document and emit but the
performance of the erlang code.

Maybe there's some contention in the view server causing an issue.

Mike    

-----Original Message-----
From: Randall Leeds [mailto:randall.leeds@gmail.com] 
Sent: Tuesday, March 09, 2010 1:06 PM
To: user@couchdb.apache.org; dev@couchdb.apache.org
Subject: Re: Erlag View performance

If there's discussion to be had here, it should maybe go over to dev@,
so I'm crossposting there.

I looked at the code (only briefly), but you can take a look too...

src/couchdb/couch_native_process.erl

It looks like the functions are (as per the view server api) parsed
only once and then just applied to the documents.
Now, the foldrows function is not just a call to lists:foldl, so maybe
there's a little extra overhead here.
Also, there might be more i/o contention when the results are being
written to the view index rather than just output in your eclipse
console (or maybe I don't understand your benchmark exactly).

If you are writing erlang views you must know some erlang, so maybe
take a look and see if you can't optimize the view server a bit.

Cheers!

-Randall

On Tue, Mar 9, 2010 at 08:46, Michael McCaffrey <mmccaffrey@ittvis.com>
wrote:
> Reposting, to try and get some traction on this. Baffled as to why the
> view takes 10-20 times longer per record in couch than running in pure
> erlang environment.
>
> When each record takes almost a second, things run forever...
>
> Any help appreciated.
>
>
>
> Hello,
>
> I'm using an erlang view to fold thru large deep lists and have a
> performance issue.
>
> Being a relative erlang newbie I thought it was a codingsue,
however...
>
> When I run thru a document locally (in Eclipse) I can fold thru the
doc
> in 47000 micro seconds.
>
> When I fold thru the same document during the view, it takes almost a
> full second (900000 micro seconds). All the documents take about this
> long.
>
> Any thoughts on why this may be happening?
>
> Thanks
>
>
>
>

Mime
View raw message