[erlang-questions] which one is more efficiency? ets or pattern match?
Thu Mar 17 14:45:29 CET 2016
in somewhat related i studied recently the impact of each for a simple
lookup in erlang-idna. The main goal was to find the best write-once
read-only K/V data structure to embed in a beam without the cost of ets or
between pattern matching and maps on a string with 29915 entries maps were
faster and - not sure why - it creates a smaller beam. Maps are also faster
to compile and use less memory in the process.
anyway you should probably test the right one for your case.
On Wed, 16 Mar 2016 at 09:05, 饕餮 <249505968@REDACTED> wrote:
> erlang pattern match file could be written like :
> get(1) -> 11,
> get(2) -> 22,
> get(1000001) -> 12312,
> get(_) -> none.
> When I need get some data,
> ets:lookup(some_table, some_value)
> Which one is more efficiency?
> How much different between them?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions