[erlang-questions] Best Practice in Map keys: Atoms or Binaries (or Strings)?

Uniaika uniaika@REDACTED
Sat Oct 1 12:39:49 CEST 2016


Maybe this blog post (originally for Elixir though) will help you:
https://engineering.appcues.com/2016/02/02/too-many-dicts.html

TL;DR

>	WUse string-keyed maps for data which has just arrived from an >
external source.

>	Convert external data to structs as soon as possible.

>	Use structs almost everywhere else in your program.

>	Use other atom-keyed maps sparingly.

On 10/01/2016 12:37 PM, Pagayon, Ruel wrote:
> Hi everyone,
> 
> I'm just wondering (assuming the keys of my maps in my application is
> not dynamically generated):
> 
> 1. What is the most optimal key type for maps?
> 2. If there is little to no effect in performance (or resources in
> general), as a convention, which is the best to use?
> 
> Thank you in advance for your responses.
> 
> Cheers,
> Ruel
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> 



More information about the erlang-questions mailing list