ArraysRRBVector

An Arrays implementation based on a set of NIFs (Natively Implemented Functions) written in Rust. The internal representation of the array is an immutable persistent datastructure known as a 'Relaxed Radix Balanced Vector', provided by the im library (im::Vector).

Since the performance of this library seems subpar, it is unlikely that the library will be developed further (unless other approaches to improve performance are discovered).

Performance

With benchmarking this implementation against the pure-Elixir implementations of Arrays (Erlang's :array and a Map-based array) we find out that unfortunately the overhead of calling a NIF overshadows any performance gains that would be obtained from using this close-to-the-metal implementation of a RRBVector.

The benchmarks can be run by running mix run benchmarks/benchmarks.exs. Below graphs were constructed from the CSV results.

random_updaterandom_updaterandom_readrandom_readappendappendappend

Installation

ArraysRRBVector is available in Hex, and can be installed by adding arrays_rrb_vector to your list of dependencies in mix.exs:

def deps do
  [
    {:arrays_rrb_vector, "~> 0.1.0"}
  ]
end

Documentation can be found at https://hexdocs.pm/arrays_rrb_vector.