couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <>
Subject [jira] Closed: (COUCHDB-747) use lists:keysearch BIF to traverse ejson
Date Tue, 04 May 2010 02:09:56 GMT


Adam Kocoloski closed COUCHDB-747.

    Resolution: Fixed


> use lists:keysearch BIF to traverse ejson
> -----------------------------------------
>                 Key: COUCHDB-747
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: Database Core
>    Affects Versions: 0.11
>            Reporter: Adam Kocoloski
>             Fix For: 1.1
> We use proplists:get_value to inspect JSON Objects in Erlang.  I think we should switch
to lists:keysearch.  It's a BIF and appears to be 2-3x faster than proplists for a wide class
of lookups.  Here's a microbenchmark:
> The get_value() functions in that gist provide a wrapper around keysearch to give it
the same interface as proplists:get_value.  The only incompatibility in the wrapper is that
proplists will find atoms (instead of tuples) in the list, while keysearch will ignore them.
 But our JSON term format doesn't contain any standalone atoms, so this is not an issue for

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

View raw message