# discord/sorted_set_nif

Elixir SortedSet backed by a Rust-based NIF

Repository: https://github.com/discord/sorted_set_nif
Canonical: https://ross.abutalabs.com/products/sorted_set_nif
Language: Elixir
License: MIT
License Family: permissive
Last push: 2026-05-13T23:58:11+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 82, release rhythm 35, longevity 100
- inputs: {"age_days": 2837, "days_push": 112, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1648, forks 101 (observed 2026-08-28T04:05:16.600417+00:00)

## What it is
An Elixir SortedSet data structure library implemented as a Native Implemented Function (NIF) in Rust using the Rustler crate. It provides sorted, unique collections with index reporting and random access, backed by a vector-of-vectors structure similar to a skip-list.

## Use cases
- maintain a sorted set of terms in Elixir with fast operations
- get the index of items when adding or removing from a sorted collection
- random access into a sorted collection by index or slice
- store large sorted sets in Elixir without performance bottlenecks
- tune bucket sizes for specific workload performance

## When to choose
- you need guaranteed sorted order and uniqueness for Elixir terms
- you need index reporting and random access on a set
- you are building performance-sensitive Elixir applications handling large sorted collections

## When to avoid
- you need to store references, pids, ports, functions, or floats
- you need constant-time set operations that SortedSet cannot guarantee
- you want a pure-Elixir dependency without native code compilation

## Facets
- artifact type: library
- maturity: stable
- function: data-science, developer-tools
- domain: developer-tools
- platform: elixir, rust
- tags: sorted-set, nif, rustler, elixir, data-structure, algorithms

## Member repositories
- discord/sorted_set_nif (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:16.600417+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:45:12.831992+00:00, confidence not recorded.
  - readme: https://github.com/discord/sorted_set_nif (fetched 2026-08-28T04:05:16.600417+00:00, sha 2fa139006813)
- Data as of 2026-08-30T08:39:29.467469+00:00.
