couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <>
Subject [jira] Created: (COUCHDB-798) Compile mochijson2 down to native code
Date Tue, 15 Jun 2010 14:25:24 GMT
Compile mochijson2 down to native code

                 Key: COUCHDB-798
             Project: CouchDB
          Issue Type: Improvement
          Components: Database Core
            Reporter: Adam Kocoloski
             Fix For: 1.1

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.


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

View raw message