couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Joseph Davis (JIRA)" <>
Subject [jira] Commented: (COUCHDB-798) Compile mochijson2 down to native code
Date Mon, 15 Nov 2010 16:35:13 GMT


Paul Joseph Davis commented on COUCHDB-798:

I wonder if we can do a middle ground thing between all native and none native controlled
by a ./configure parameter like --native-modules or some such. Seems like it'd  be easy enough
to add an erlc flag and ifdef the -compile(native) directive.

> Compile mochijson2 down to native code
> --------------------------------------
>                 Key: COUCHDB-798
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: Database Core
>            Reporter: Adam Kocoloski
>             Fix For: 1.2
> Adding a -compile(native) flag to mochijson2.erl results in a marked performance improvement
for large documents.  I did the following test
> node compare_write.js -u -v -1 trunk -2 mochijson2-native
-d large -r 2 -t 90 -c 200
> and got the results at [1].  The graph shows that the average client response time dropped
by about 35% with the native encoder.  Qualitatively, I also noticed that the native encoder
used substantially fewer CPU cycles.  On my dual core Macbook, idle CPU went from ~10% on
trunk to ~25% with the +native version while the test was running.
> Running the same test with small documents showed essentially no difference between the
two comparatives, which is not surprising.
> A potential downside of +native is instability in the VM.  I've encountered issues on
AMD machines with R13B04 when using +native for all modules, and the core dump pointed to
an issue in HiPE.  On the other hand, I think that mochijson2 should work very well as native
code, since it doesn't do any message passing or I/O.  I'm +1 on simply adding the compile
option to the codebase in trunk to see how it behaves.
> [1]:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message