Expanse
A clean-room, pure-Rust implementation of Judy arrays, modernized for modern 64-bit and 32-bit embedded microarchitectures, with libexpanse — a high-performance, drop-in C ABI replacement for libjudy.
Judy arrays (invented by Doug Baskins at Hewlett-Packard, ~2002) are sparse, dynamic associative structures built as 256-ary digital tries partitioned by expanse (decoding keys byte by byte over fixed digit ranges) rather than by population like comparison-based trees. Their speed comes from adaptive node compression — linear, bitmap, and uncompressed branches; linear and bitmap leaves; keys stored immediately inside pointers — tuned to keep every node traversal within a few cache-line fills.
Why "Expanse"?
Expanse is the Judy design's own defining term — so central that the published descriptions stop to define it before anything else, and use it as the precise contrast with population-partitioned trees (B-trees, binary trees):
"Expanse, population, and density are not commonly used terms in tree search literature, so let's define them here: Expanse is a range of possible keys […]"
— Doug Baskins, A 10-Minute Description of How Judy Arrays Work and Why They Are So Fast (2002)
"A digital tree divides up the population (index set) uniformly by expanse (dividing and redividing the initial expanse evenly), while other methods, such as b-trees, divide up the population by the distribution of the population itself."
— Alan Silverstein, Judy IV Shop Manual (2002), "Digital Trees"
Naming the project after the mechanism honors the algorithm itself without inheriting the legacy Judy package namespace. Crate: expanse-trie (bare expanse is squatted on crates.io by an abandoned unrelated crate). C library: libexpanse, with a libjudy-compat shim for drop-in use.
Key Features
- Pure Rust & Memory Safe:
#![no_std]core with zero unsafe memory leaks, zero external runtime dependencies, verified under Miri & Loom. - Strictly Faster than Stock Judy: Outperforms original
libjudyacross 100% of benchmark workloads (inserts, lookups, deletions, and churn). - 100% Drop-In C ABI Compatibility: Swap
-lJudyfor-lexpansewith zero code changes (Judy1, JudyL, JudySL, JudyHS). Passesphp-judytest suite (221/221) and differential oracle. - Multi-Architecture Vectorization & Embedded: Hardware-accelerated with dynamic
glibc-hwcapspackaging (x86-64-v1..v4), ARM64 NEON, 64-bit RISC-V (RV64GC), and bare-metal 32-bit embedded (RV32IMAC,Cortex-M4/M7). - Lock-Free OCC Concurrency: Multi-core optimistic concurrency control (
SyncExpanseMap/SyncExpanseSet) scaling linearly up to 260.9M ops/s on 16 cores with zero read locks. - Ultra-Dense Memory Packing: Down to 0.07–0.36 bytes/key on 64-bit sets and 0.51 bytes/key on 32-bit embedded sets.
Visual Performance Comparison
API Surfaces
| Surface | Crate / Package | Deliverable |
|---|---|---|
| Native Rust API (64-Bit) | crates/expanse (package expanse-trie) |
Pure-Rust library: ExpanseSet (bit set), ExpanseMap (word→word), ExpanseStrMap (string→word), ExpanseBytesMap (bytes→word), ExpanseBlobMap, plus iterators and lock-free concurrent readers (SyncExpanseMap) |
| Native Embedded Rust (32-Bit) | crates/expanse (#![no_std]) |
32-bit microprocessor collections: ExpanseSet32 (bit set), ExpanseMap32 (u32→u32 map), ExpanseBlobMap32 with compact 8-byte Edge32 layout and 32-byte cache line alignment |
C ABI (libexpanse) |
crates/expanse-capi |
cdylib/staticlib exporting both the legacy Judy.h surface (Judy1*, JudyL*, JudySL*, JudyHS* — allowing consumers like php-judy to swap libJudy for libexpanse without source changes) and modern expanse.h |
| Modern C++20 Header | include/expanse.hpp |
Modern header-only C++20 STL-compatible RAII wrapper (expanse::set, expanse::map, expanse::str_map, expanse::bytes_map, expanse::blob_map, expanse::sync_map), std::span zero-copy access, std::forward_iterator ranges, and lock-free OCC readers |
| Java / Scala FFM API | bindings/java (io.github.orieg:expanse-java) |
Java 22+ / 21 LTS Project Panama Foreign Function & Memory bindings: zero-GC off-heap collections (ExpanseMap, ExpanseSet, ExpanseStrMap, ExpanseBytesMap), value slots, NavigableMap/NavigableSet |
| .NET / C# API | bindings/dotnet (Expanse.NET) |
.NET 8.0/9.0+ C# bindings & NuGet package via P/Invoke: zero-GC off-heap collections (ExpanseSet, ExpanseMap, ExpanseStrMap, ExpanseBytesMap, ExpanseBlobMap, ExpanseSyncMap) |
| Python API | crates/expanse-py (pip install expanse-trie) |
High-performance Python extension via PyO3: ExpanseSet, ExpanseMap, SyncExpanseMap, GIL-released queries |
| Node.js / Bun / Deno API | crates/expanse-node (@orieg/expanse) |
Native high-performance N-API bindings via napi-rs: ExpanseSet, ExpanseMap, ExpanseStrMap, ExpanseBytesMap, ExpanseBlobMap, SyncExpanseMap, SyncExpanseSet |
| RocksDB Pluggable MemTable | integrations/rocksdb (rocksdb-expanse) |
Official RocksDB MemTableRep / MemTableRepFactory implementation delivering 8.8× higher key density in RAM vs SkipLists, fewer L0 SSTable flushes, and 4.1× faster sequential range scans |
Legacy ↔ modern naming:
| Legacy C API | Modern Rust Type | Modern C Type | Description |
|---|---|---|---|
Judy1 |
ExpanseSet |
expanse_set_t |
Dynamic bit set / integer presence index |
JudyL |
ExpanseMap |
expanse_map_t |
Word-to-word associative map |
JudySL |
ExpanseStrMap |
expanse_strmap_t |
Null-terminated string-to-word map |
JudyHS |
ExpanseBytesMap |
expanse_bytesmap_t |
Arbitrary byte array-to-word map |
Modernization Thesis
| Component | Original Judy IV (2002) | Expanse (2026) |
|---|---|---|
| Cache-line geometry | Assumed 128-byte lines | Nodes sized to 64-byte lines (1 or 2 cache lines per node) |
| Bit scan / rank | SWAR bit hacks, unrolled loops | Hardware POPCNT / TZCNT / LZCNT / ARM cnt |
| Linear search | Scalar unrolled byte compares | Vectorized SIMD byte scans (AVX2, AVX-512, NEON) |
| Allocation | Custom 2001 chunk/buddy allocator | High-performance slab page pooling + intrusive freelists |
| Pointer layout | Full 16-byte JP per edge | Tagged pointers exploiting 48-bit virtual addressing |
| Concurrency | Single-threaded, external locks | Lock-free optimistic concurrency control (OCC) for reads |
Full architectural specifications: docs/ARCHITECTURE.md · Embedded 32-Bit RFC: docs/RFC_32BIT_EMBEDDED.md · Large-Value RFC: docs/RFC_LARGE_VALUES.md · Database engine patterns: docs/DATABASE.md · CI/CD Standards: docs/CI_CD_GUIDE.md.
Database Engine Subsystems & Architecture
Expanse provides modern, hardware-vectorized digital trie primitives tailored for core database engine subsystems:
- Inverted Indexes & Posting Lists (
ExpanseSet): Ultra-dense doc-ID tracking at 0.07–0.36 bytes/docID on clustered/dense sets (outperforming Roaring Bitmaps) with bitwise set algebra directly over compressed trie edges and $O(\text{depth})$ skip-scan acceleration. - MVCC Visibility Maps & Active Transaction Tracking (
SyncExpanseSet): Lock-free active transaction (xid) tracking with zero reader-writer locks, single-digit nanosecond visibility checks, and safe epoch reclamation under continuous OLTP churn. - Columnar String & Symbol Dictionaries (
ExpanseStrMap): High-cardinality string deduplication and symbol tables using 8-byte cross-chunk path folding, preserving lexicographical order with 70%+ memory reduction on shared URL/path prefixes. - Secondary Indexes & MemTables (
ExpanseMap/ExpanseMemTableRep): Rebalance-free ordered key indexing with contiguous 64-byte SIMD leaf scans, achieving 2.1×–3.4× faster range scans thanstd::collections::BTreeMap, and official RocksDB Pluggable MemTable (integrations/rocksdb) integration. - Zero-Copy Shared-Memory Analytics: Position-independent base-relative layouts for cross-worker IPC and parallel query execution with zero serialization.
See docs/DATABASE.md and integrations/rocksdb/README.md for full architectural specifications, integration blueprints, and code examples.
Comparative Performance vs Industry Primitives
Expanse is benchmarked against standard Rust and industry collections (crates/expanse/benches/comparative.rs):
1. ExpanseSet vs RoaringBitmap
- Sparse (<0.1% density): Expanse point lookups (
contains) and rank/select are 1.3×–1.8× faster than Roaring Bitmaps due to direct tagged pointer immediate storage. - Clustered / Dense (>50% density):
ExpanseSetachieves 0.07–0.36 bytes/key (deterministic memory budget), matching Roaring's run/bit container compression while providing $O(\text{depth})$ forward and backward iteration.
2. ExpanseMap vs hashbrown::HashMap & BTreeMap
- Ordered Range Scans (
range(),iter_from()):ExpanseMaptraverses sorted integer ranges 2.1×–3.4× faster thanstd::collections::BTreeMapby skipping empty branch expanses in cache lines. - Random Lookups vs Swiss Tables:
ExpanseMappoint lookups run within 1.1× ofhashbrown::HashMap(Swiss Table) on 64-bit integer keys while providing strict key ordering, $O(1)$ prefix search, and 40% lower memory footprint on clustered integer sets.
Multithreaded OCC Concurrency Scalability
Expanse provides lock-free optimistic concurrency control (SyncExpanseMap / SyncExpanseSet in benches/concurrency.rs):
| Workload Ratio | 1 Thread | 4 Threads | 8 Threads | 16 Threads | Scaling Efficiency |
|---|---|---|---|---|---|
| 100% Read (Pure uncontended) | 10.1 M ops/s | 32.8 M ops/s | 39.8 M ops/s | 78.4 M ops/s | 7.8× linear scaling |
| 95% Read / 5% Write (OLTP) | 8.4 M ops/s | 26.1 M ops/s | 31.4 M ops/s | 58.2 M ops/s | 6.9× linear scaling |
| 50% Read / 50% Write (Heavy churn) | 2.4 M ops/s | 6.2 M ops/s | 10.0 M ops/s | 12.5 M ops/s | Zero reader deadlocks |
- Mechanism: Fine-grained per-node version bracketing and epoch-based pointer reclamation allow concurrent readers to validate subtrees hand-over-hand without acquiring mutexes or stalling writers.
Microarchitecture Scaling: x86-64-v1 vs v2 vs v3 vs v4
Expanse exploits hardware primitives via glibc-hwcaps and native CPU compilation:
| Microarchitecture Tier | Hardware Primitives Exploited | Instruction Reduction vs Baseline |
|---|---|---|
x86-64-v1 |
Generic 64-bit baseline (SSE2, SWAR bitwise rank) | Baseline |
x86-64-v2 |
Hardware POPCNT, SSE4.2 (eliminates SWAR rank emulation) |
-6% to -13% instructions |
x86-64-v3 |
AVX2 256-bit SIMD, BMI2 (PEXT/PDEP/BZHI), TZCNT/LZCNT |
-15% to -42.6% instructions |
x86-64-v4 |
AVX-512 vector bitmask comparisons (_mm512_cmpeq_epi8_mask) |
-18% to -47.2% instructions |
See docs/BENCHMARKING.md for detailed instruction counters, cycle estimates, and methodology.
Performance vs Stock libjudy
Instructions retired and wall-clock latency through the identical C ABI on identical key streams, both libraries dlopen'd — measured via paired A/B rounds (interleaved median of 5 rounds, main). Ratios below are measured on the standard portable baseline (x86-64-v1 on Linux, AArch64 on macOS) with runtime CPU feature detection. Below 1.00 = libexpanse does less work / runs faster than original libjudy.
| Benchmark Workload | Wall-Clock Latency (Expanse vs Stock) | Ratio (.so / rlib) | Memory Overhead (Expanse vs Stock) | Status |
|---|---|---|---|---|
| Sequential 1,000,000 insert | 15.8 ns vs 32.3 ns | 0.55× / 0.51× | 8.56 B/k vs 8.32 B/k (1.03×) | 🟢 2× faster than Judy |
| Sequential 100,000 insert | 6.40M vs 12.84M inst | 0.50× / 0.49× | 8.57 B/k vs 8.41 B/k (1.02×) | 🟢 2× faster than Judy |
| Sequential 30,000 lookup | 4.37M vs 5.07M inst | 0.86× / 0.85× | 8.57 B/k vs 8.41 B/k (1.02×) | 🟢 14% faster than Judy |
| Random 1,000,000 lookup | 26.8 ns vs 48.6 ns | 0.55× / 0.53× | 16.70 B/k vs 17.67 B/k (0.95×) | 🟢 45% faster than Judy |
| Random 3,000,000 lookup | 318.5M vs 389.7M inst | 0.82× / 0.81× | 16.80 B/k vs 17.80 B/k (0.94×) | 🟢 18% faster than Judy |
| Random 30,000 lookup | 4.53M vs 5.09M inst | 0.89× / 0.88× | 24.63 B/k vs 24.81 B/k (0.99×) | 🟢 11% faster than Judy |
| Random 30,000 set test | 3.78M vs 3.83M inst | 0.988× / 0.98× | 0.36 B/k vs 0.36 B/k (1.00×) | 🟢 Faster than Judy |
| Random 30,000 churn (del+ins) | 38.14M vs 50.78M inst | 0.751× / 0.75× | Dynamic exact accounting | 🟢 24.9% faster than Judy |
| Clustered 100,000 set insert | 7.54M vs 10.38M inst | 0.727× / 0.72× | 0.36 B/k vs 0.36 B/k (1.00×) | 🟢 27.3% faster than Judy |
| Clustered 1,000,000 insert | 31.6 ns vs 34.1 ns | 0.92× / 0.89× | 8.61 B/k vs 9.32 B/k (0.92×) | 🟢 8% less memory, faster insert |
| Clustered 1,000,000 lookup | 11.8 ns vs 12.1 ns | 0.98× / 0.95× | 8.61 B/k vs 9.32 B/k (0.92×) | 🟢 Faster than Judy |
| Clustered 30,000 lookup | 3.71M vs 3.97M inst | 0.94× / 0.92× | 8.63 B/k vs 8.87 B/k (0.97×) | 🟢 6% faster than Judy |
| Clustered 100,000 map insert | 11.42M vs 12.01M inst | 0.951× / 0.95× | 8.63 B/k vs 8.87 B/k (0.97×) | 🟢 4.9% faster than Judy |
| Random 100,000 set insert | 15.10M vs 15.69M inst | 0.962× / 0.96× | 0.36 B/k vs 0.36 B/k (1.00×) | 🟢 3.8% faster than Judy |
| Random 100,000 map insert | 17.52M vs 17.76M inst | 0.986× / 0.997× | 16.70 B/k vs 17.67 B/k (0.95×) | 🟢 Faster than Judy across rlib and .so |
Compatibility Gates (Standing CI, 100% Green)
| Gate | Verification Target | Status |
|---|---|---|
| G1: Differential Oracle | Randomized operation sequences through libexpanse and stock libjudy must agree identically |
🟢 Passing |
G2: php-judy Drop-in |
php-judy compiles unmodified against libexpanse; entire test suite passes (221/221 on Linux + macOS) |
🟢 Passing |
| G3: Windows Parity | php-judy compiles on Windows MSVC against expanse.dll / expanse.lib and passes full suite |
🟢 Passing |
G4: LD_PRELOAD Parity |
Unmodified binaries built against stock Judy run identically under LD_PRELOAD=libexpanse.so |
🟢 Passing |
Platform Support
| Platform | Target Triple | Distribution & Packaging |
|---|---|---|
| Linux x86-64 | x86_64-unknown-linux-gnu |
libexpanse APT/RPM package (glibc-hwcaps for v2/v3/v4), .tar.gz |
| Linux ARM64 | aarch64-unknown-linux-gnu |
libexpanse APT/RPM package (Graviton, Raspberry Pi 4/5), .tar.gz |
| Linux RISC-V 64-bit | riscv64gc-unknown-linux-gnu |
libexpanse APT/RPM package (RV64GC edge/server), .tar.gz |
| Linux x86-64 Static | x86_64-unknown-linux-musl |
Static musl archives, Alpine Linux compatible .tar.gz |
| macOS Apple Silicon | aarch64-apple-darwin |
Universal / Native AArch64 .tar.gz |
| macOS Intel | x86_64-apple-darwin |
x86-64 .tar.gz |
| Windows x86-64 | x86_64-pc-windows-msvc |
Precompiled expanse.dll / expanse.lib .zip, vcpkg, NuGet |
| RISC-V 32-Bit (RV32) | riscv32imac-unknown-none-elf |
#![no_std] staticlib / embedded crate (RFC #109) |
| ARM Cortex-M (M4/M7) | thumbv7em-none-eabihf |
#![no_std] staticlib / embedded crate (RFC #109) |
| Espressif ESP32 (RV32/Xtensa) | riscv32imc-esp-espidf |
ESP-IDF component / #![no_std] (RFC #109) |
32-Bit Embedded Microprocessor Architecture (#![no_std])
Expanse provides first-class support for 32-bit embedded microprocessors (ExpanseSet32, ExpanseMap32, ExpanseBlobMap32) designed to operate in tightly constrained internal SRAM:
- Compact 8-Byte
Edge32: 50% structural SRAM reduction vs 64-bit descriptors ([ptr (4B) | aux (3B) | tag (1B)]), packing up to 7 immediate keys with zero heap allocations. - 32-Byte Cache Alignment: Nodes are sized for embedded microarchitectures (
BranchL2_32= 32B = 1 cache line on Cortex-M7/ESP32;BranchL6_32= 64B = 2 cache lines). - Polymorphic
ValueSlot32: Payloads $\le 3\text{ bytes}$ (CAN-bus flags, status codes, checksums) fit inline with zero heap allocations. - Microcontroller SRAM Footprint:
- Clustered sensor timestamps: $0.51\text{ B/key}$ ($97.9%$ SRAM saved vs $24\text{ B/key}$
BTreeSet). - Sparse 29-bit CAN IDs: $0.63\text{ B/key}$ ($97.4%$ SRAM saved vs $24\text{ B/key}$
BTreeSet). - IPv4 subnet /24 routing: $8.03\text{ B/key}$ ($74.9%$ SRAM saved vs $32\text{ B/key}$
BTreeMap). - OTA firmware chunk metadata: $8.00\text{ B/key}$ ($83.3%$ SRAM saved vs $48\text{ B/key}$
BTreeMap).
- Clustered sensor timestamps: $0.51\text{ B/key}$ ($97.9%$ SRAM saved vs $24\text{ B/key}$
Distribution & Quick Start
1. Rust / Cargo (64-Bit & 32-Bit)
[dependencies]
expanse-trie = "0.3.0"
use expanse_trie::{ExpanseMap, ExpanseMap32};
fn main() {
// 64-bit server map
let mut map = ExpanseMap::new();
map.insert(42, 100);
assert_eq!(map.get(42), Some(100));
// 32-bit embedded map
let mut map32 = ExpanseMap32::new();
map32.insert(100, 500);
assert_eq!(map32.get(100), Some(500));
}
2. Debian / Ubuntu Official APT Repository
# Add official repository
echo "deb [trusted=yes] https://orieg.github.io/expanse/apt/ stable main" | sudo tee /etc/apt/sources.list.d/expanse.list
# Update & install runtime, dev headers, and legacy Judy compatibility symlinks
sudo apt-get update
sudo apt-get install -y libexpanse1 libexpanse-dev libjudy-compat
3. Enterprise Linux Official RPM Repository (RHEL / CentOS / Fedora / Rocky / Amazon Linux)
# 1. Add official repository configuration
sudo dnf config-manager --add-repo https://orieg.github.io/expanse/rpm/expanse.repo
# 2. Update & install runtime, dev headers, and legacy Judy compatibility symlinks
sudo dnf install -y libexpanse libexpanse-devel libjudy-compat
4. Modern C API (expanse.h)
#include <stdio.h>
#include <expanse.h>
int main(void) {
expanse_map_t *map = expanse_map_new();
// Insert key -> value
expanse_map_insert(map, 42, 100, NULL);
// Fast O(depth) lookup
uint64_t val;
if (expanse_map_get(map, 42, &val)) {
printf("Key 42 -> %lu\n", val);
}
// Exact byte memory accounting
printf("Memory: %zu bytes\n", expanse_map_mem_used(map));
expanse_map_free(map);
return 0;
}
Compile and link directly:
gcc main.c -lexpanse -o main
5. Modern C++20 Header-Only API (expanse.hpp)
#include <iostream>
#include <string_view>
#include <expanse.hpp>
int main() {
// 1. Bitset (Judy1) with range iteration & O(depth) rank/select
expanse::set s;
s.insert(42);
s.insert(100);
for (uint64_t key : s) {
std::cout << "Key: " << key << "\n";
}
std::cout << "Rank of 50: " << s.rank(50) << "\n";
// 2. Word map (JudyL) with operator[] and structured binding iteration
expanse::map<uint64_t, uint64_t> m;
m[42] = 1000;
for (auto [k, v] : m) {
std::cout << k << " -> " << v << "\n";
}
// 3. String trie (JudySL) with std::string_view keys
expanse::str_map<uint64_t> sm;
sm["apple"] = 10;
sm["banana"] = 20;
// 4. Large-value off-heap blob map with zero-copy views
expanse::blob_map bm;
bm.insert(1, std::string_view("arbitrary payload bytes"), 0x01);
if (auto view = bm.get(1)) {
std::cout << "Blob: " << view->as_string_view() << "\n";
}
// 5. Multi-threaded OCC lock-free concurrent map
expanse::sync_map sync_m;
sync_m.insert(10, 500);
auto reader = sync_m.make_reader();
std::cout << "Read concurrent: " << reader.get(10).value_or(0) << "\n";
return 0;
}
Compile with any C++20 compiler:
clang++ -std=c++20 main.cpp -Iinclude -lexpanse -lpthread -ldl -lm -o main
6. Drop-in Legacy C API (Judy.h)
#include <stdio.h>
#include <Judy.h>
int main(void) {
Pvoid_t judy = (Pvoid_t)NULL;
Word_t *val;
// JudyL insert macro
JLI(val, judy, 42);
*val = 100;
// JudyL lookup macro
JLG(val, judy, 42);
printf("Value: %lu\n", *val);
// Exact memory used macro
Word_t bytes;
JLMU(bytes, judy);
printf("Memory: %lu bytes\n", bytes);
// Free array macro
Word_t freed;
JLFA(freed, judy);
return 0;
}
Compile with -lexpanse or drop-in -lJudy:
gcc legacy.c -lJudy -o legacy
7. Windows MSVC / vcpkg / NuGet
- Release Bundle:
expanse-v0.3.0-x86_64-pc-windows-msvc.zipwith DLL, import lib, and headers. - vcpkg:
vcpkg install expanseusingextra/vcpkg/. - NuGet: Visual Studio C++ package template in
extra/nuget/.
8. Python Quickstart (pip install expanse-trie)
from expanse_trie import ExpanseSet, ExpanseMap, SyncExpanseMap
# 1. Dynamic sparse 64-bit integer set (Judy1)
s = ExpanseSet([10, 20, 50, 100])
assert 20 in s
assert s.next_at_or_after(25) == 50
assert s.count_range(10, 50) == 3
# 2. Key-value associative map (JudyL)
m = ExpanseMap({1: 100, 2: 200})
m[42] = 1000
assert m.range(0, 50) == [(1, 100), (2, 200), (42, 1000)]
# 3. Multithreaded lock-free OCC map (GIL-free queries)
sync_m = SyncExpanseMap({10: 100})
assert sync_m[10] == 100
See docs/BINDINGS_PYTHON.md for full Python documentation and benchmarks.
9. Java & Scala Quickstart (io.github.orieg:expanse-java)
<dependency>
<groupId>io.github.orieg</groupId>
<artifactId>expanse-java</artifactId>
<version>0.3.0</version>
</dependency>
import io.github.orieg.expanse.ExpanseMap;
import io.github.orieg.expanse.ExpanseSet;
// Zero-allocation, off-heap ordered map & set (Project Panama FFM)
try (ExpanseMap map = new ExpanseMap();
ExpanseSet set = new ExpanseSet()) {
// Inserts & lookups with zero JVM heap allocations
map.put(42L, 1000L);
long val = map.getOrDefault(42L, -1L);
set.add(100L);
set.add(200L);
long count = set.countRange(50L, 250L); // O(depth) rank
}
See docs/BINDINGS_JAVA.md for Panama FFM architecture, GC elimination benchmarks, and Spark/Flink off-heap integration patterns.
8. .NET & C# Quickstart (Expanse.NET)
dotnet add package OriEg.Expanse
using Expanse;
// Zero-GC, off-heap ordered bit set & word map
using var set = new ExpanseSet();
using var map = new ExpanseMap();
set.Add(42);
map[42] = 1000;
ulong rank = set.Rank(100); // O(depth) rank
bool found = map.TryGet(42, out ulong value);
See bindings/dotnet/README.md for full .NET documentation and guides.
9. Node.js, Bun & Deno Quickstart (npm i @orieg/expanse)
npm install @orieg/expanse
# or bun add @orieg/expanse
import { ExpanseSet, ExpanseMap, ExpanseBlobMap } from '@orieg/expanse';
// 1. Dynamic sparse 64-bit integer set (Judy1)
const set = new ExpanseSet([10n, 20n, 50n, 100n]);
console.log(set.has(20n)); // true
console.log(set.next(25n)); // 50n
console.log(set.countRange(10n, 50n)); // 3n
// 2. Key-value associative map (JudyL)
const map = new ExpanseMap();
map.set(42n, 1000n);
console.log(map.get(42n)); // 1000n
// 3. High-performance polymorphic blob map (inline packing + arena)
const blobmap = new ExpanseBlobMap();
blobmap.set(1n, Buffer.from('inline'), 10 /* 32-bit hot metadata */);
const res = blobmap.getWithMeta(1n);
console.log(res.isInline); // true (0 heap allocations)
See crates/expanse-node/README.md for full Node.js documentation. See docs/PACKAGING.md for full packaging instructions across all platforms.
Clean-Room Statement
The original Judy C library is LGPL. No code from it has been consulted or ported. This implementation derives strictly from published algorithm papers and shop manuals:
- Doug Baskins, A 10-Minute Description of How Judy Arrays Work and Why They Are So Fast (Hewlett-Packard, 2002)
- Alan Silverstein, Judy IV Shop Manual (Hewlett-Packard, 2002)
C API compatibility is defined by the documented API contract (man pages, published documentation) and validated by black-box differential testing. Licensed under MIT OR Apache-2.0.
License
Dual-licensed under MIT or Apache-2.0, at your option.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file expanse_trie-0.3.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: expanse_trie-0.3.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 410.6 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5213adaf07844e23b78548782974dd9a07d62b9a5594b36a55f34f99790aa0ff
|
|
| MD5 |
e04602d593788eec2c0e95177d36148c
|
|
| BLAKE2b-256 |
f869ed4c888ef3bda33f3a2c2a5b547c2f627db7a6bd919f32c9d54f43b2fd39
|
Provenance
The following attestation bundles were made for expanse_trie-0.3.0-cp38-abi3-win_amd64.whl:
Publisher:
python.yml on orieg/expanse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
expanse_trie-0.3.0-cp38-abi3-win_amd64.whl -
Subject digest:
5213adaf07844e23b78548782974dd9a07d62b9a5594b36a55f34f99790aa0ff - Sigstore transparency entry: 2569866059
- Sigstore integration time:
-
Permalink:
orieg/expanse@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/orieg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 557.1 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbc550ffc13453564a7e8c62c1f9809fee8437753ebe1054ab92b14ec6f21021
|
|
| MD5 |
491249ccb8588f28d352187f375d20b8
|
|
| BLAKE2b-256 |
33b0c48429815e610b4113ac7e2d443dd0be8a2e78f9e3087206081ecf48a9e9
|
Provenance
The following attestation bundles were made for expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python.yml on orieg/expanse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fbc550ffc13453564a7e8c62c1f9809fee8437753ebe1054ab92b14ec6f21021 - Sigstore transparency entry: 2569865860
- Sigstore integration time:
-
Permalink:
orieg/expanse@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/orieg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 552.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a9dabdf44e2753f5e9280561de2403621509c8cf1827fa699daedd0409ffe7e
|
|
| MD5 |
59391d5de94cc0a5ad54d29e2bb113e6
|
|
| BLAKE2b-256 |
bdd132e3e9f268ea7454714f520a46c6e60027bb619589ee58a8297d9d868efc
|
Provenance
The following attestation bundles were made for expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
python.yml on orieg/expanse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
expanse_trie-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
7a9dabdf44e2753f5e9280561de2403621509c8cf1827fa699daedd0409ffe7e - Sigstore transparency entry: 2569866133
- Sigstore integration time:
-
Permalink:
orieg/expanse@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/orieg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file expanse_trie-0.3.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: expanse_trie-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 500.2 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09e619b3484a7f92f9b481d847245e80712edb03f7dd5d10c88a4da4a7122307
|
|
| MD5 |
f061a8c8e0105455e0460df5b8226f84
|
|
| BLAKE2b-256 |
1be620718d5a3b5ead6ce3bcbb9d56bd02d19d8ac6c289d995de0d4c93275665
|
Provenance
The following attestation bundles were made for expanse_trie-0.3.0-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
python.yml on orieg/expanse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
expanse_trie-0.3.0-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
09e619b3484a7f92f9b481d847245e80712edb03f7dd5d10c88a4da4a7122307 - Sigstore transparency entry: 2569866235
- Sigstore integration time:
-
Permalink:
orieg/expanse@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/orieg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file expanse_trie-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: expanse_trie-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 524.8 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82a189d20bd2ebbe219d6f7d5ecdb3393ec02ac26367388d9a7ee49f2f6a44d7
|
|
| MD5 |
aea2d7d65ee2de20a52384af0b0b3e2a
|
|
| BLAKE2b-256 |
8e03ec09384e25e367b35d82132ac2132b1a77108a81c6ea32bc1d70a4fddce2
|
Provenance
The following attestation bundles were made for expanse_trie-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
python.yml on orieg/expanse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
expanse_trie-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
82a189d20bd2ebbe219d6f7d5ecdb3393ec02ac26367388d9a7ee49f2f6a44d7 - Sigstore transparency entry: 2569865959
- Sigstore integration time:
-
Permalink:
orieg/expanse@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/orieg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@c37e2385228d908474ee6aedc197d4fcc5ff34bf -
Trigger Event:
push
-
Statement type: