[erlang-questions] ets table instead of large record

Ulf Wiger ulf.wiger@REDACTED
Sat Oct 22 13:19:21 CEST 2011


Have you measured whether this is actually beneficial?

I'm not convinced that updating an 80-element record is much more expensive than storing an attribute in an ets table.

Another alternative is to use a proplist, orddict or gb_trees structure. It depends on the size of the payload, but also, I recall running a comparison once for a particular application, and found that I needed to store 100 tuples in a list before an ets table became competitive compared to the keysearch et al BIFs.

BR,
Ulf W

On 22 Oct 2011, at 12:56, Joel Reymont wrote:

> I have a record of 80 fields or so.
> 
> I would like to use an ETS table for each instance of this record.
> 
> Each field of the record would become a separate key in my table.
> 
> Are there any drawbacks to this approach?
> 
> 	Thanks, Joel
> 
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com






More information about the erlang-questions mailing list