[erlang-questions] where it's the best way to store a very big term object shared between processes
Thu Oct 22 10:29:17 CEST 2015
In one of my projects I need to use a radix tree. I found out a very nice
Lookup performances are great. But I have one problem.
Basically my tree has around 100 000 elements so building it it's an
extremely operation. For this reason I'm building it once and all processes
that needs to do lookups need to share the btrie object (created using
Here I see several options:
1. Use a gen server and store the btrie object on the state or process
dictionary. - I didn't tried this
2. Use a ets table and store the tire object on a public table where all
processes can read and write.
Doing some benchmarks I see that lookup-ing for the longest prefix (btrie:
find_prefix_longest) in around 100 K elements by prefix it's around 2- 5 ms
and 95% of the time is spent in the ets:lookup.
I think the time spent there is so big because also my term stored there is
Any other suggestions ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions