incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Samuel Newson <rnew...@apache.org>
Subject Re: Erlang proplists for Docs
Date Thu, 27 Feb 2014 11:40:47 GMT
Proplists are just lists of tuples, so finding keys is linear.

You can convert lists to dict (http://www.erlang.org/doc/man/dict.html) and back again, but
whether this will matter in a map function will require benchmarking. I’m really doubtful
though, the cost of the conversion is surely higher than the gain.

B.

On 27 Feb 2014, at 09:50, Stanley Iriele <siriele2x3@gmail.com> wrote:

> Basically my case is that I may have a doc with hundreds of keys
> potentially and was curious about the behavior
> 
> 
> On Thu, Feb 27, 2014 at 1:12 AM, Stanley Iriele <siriele2x3@gmail.com>wrote:
> 
>> I'm fairly new to erlang and I am going through the docs couchdb docs
>> again and its shows that proplists are the way objects documents are stored
>> when you interact with them in an map function (or whatever other function).
>> 
>> My question is...from what I have read proplists have linear performance
>> and are not like a dictionary so when fetching a key...its actually linear
>> not O(1). Am i misunderstanding something something about erlang?...is
>> there a map like structure in Erlang or something?. Anyways,,any clarity on
>> this matter would be greatly appreciated
>> 


Mime
View raw message