Had a look. I’ll throw in a couple of examples now and maybe benchmark later.
Create new :
:gb_trees.empty
Populate with 10 elements :
gb = 1..10 |> Enum.reduce(:gb_trees.empty, fn x,acc -> :gb_trees.insert(x,x,acc) end)
Iterating elements :
{k,v,next} = :gb_trees.next(iter)
I will mention I started looking at native code to solve my issue (need high performance). Here’s what I also considered.. After some investigation, I came across klib library (pure C, license X11/MIT) and it’s KBtree ordered map implementation. Considering wrapping it with a NIF.


















