couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randall Leeds (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-798) Compile mochijson2 down to native code
Date Mon, 15 Nov 2010 20:04:13 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932169#action_12932169
] 

Randall Leeds commented on COUCHDB-798:
---------------------------------------

+1 on both accounts

I'm a little nervous about turning this on by default anywhere. While I wish we could just
be optimistic it's important for us to be conservative especially when we don't have comprehensive
testing across a grid of OS/Erlang combinations, HiPE/regular, etc. But *I'd* like to turn
it on in selective places for my own builds.

On the other hand, making it default for mochijson in the absence of any flags seems like
a reasonable thing to do on trunk, maybe just after the next release so it can bake a while.
I think Adam's reasoning is sound about it being a pretty innocuous, but important, part of
the code to have running with native speedups.

> Compile mochijson2 down to native code
> --------------------------------------
>
>                 Key: COUCHDB-798
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-798
>             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 http://127.0.0.1:5984 -v http://127.0.0.1:5985 -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]: http://mikeal.couchone.com/graphs/_design/app/_show/compareWriteTest/e69057a29bd6e4ac4ae0115fac00ae50

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


Mime
View raw message