NS Suite

Production data has shape. Timestamps arrive in order. Geometry clusters. Logs share prefixes. Lattices repeat. NS products are built around that structure. The benchmarks reflect it: wins are consistent on structured workloads, losses on random distributions are documented. Random data does not exist in production.


NSAlloc

Arena allocator with bulk-reset optimization

Pattern NS (ns/op) mimalloc (ns/op) Speedup
Bulk Reset (NSMultiPool) 113.8 967.2 8.5x
Fixed-Size Hot Path (NSPool<64,64>) 2.59 3.33 1.3x
g++ -O3 -march=native -std=c++17 alloc_bench_final.cpp -o bench && ./bench
→ Try it yourself

NSBVH

Bounding volume hierarchy for ray tracing

1.37x-1.44x Embree on clustered/mixed scenes. Win condition: structured/clustered geometry: the majority of production workloads.

Scene Type NS (ms) Embree (ms) Speedup
Sparse Clustered (20 clusters) 7.16 9.82 1.37x
Mixed (10 clusters + 5K random) 9.12 13.11 1.44x
Dense Uniform (10K random) 6.96 4.38 1.59x Loss
g++ -O3 -march=native -std=c++17 nsbvh_bench.cpp -o bench && ./bench
→ Try it yourself

NSCache

LRU cache with hot tier protection

Workload Size NSCache LRU Speedup
Random 131K 66.24 237.49 3.58x
Sequential 1M 135.23 88.78 0.66x (hashing overhead)
g++ -O3 -march=native -std=c++17 bench_nscache.cpp -o bench && ./bench
→ Try it yourself

NSComp

Schema-aware game data compression

Compressor Ratio Decompress (ms) Speedup
NSComp 7.54x 0.89 29x vs zstd
zstd 7.26x 25.8 -
LZ4 3.97x 9.66 -
g++ -O3 -march=native -std=c++17 nscomp_bench.cpp -o bench && ./bench
→ Try it yourself

NSFFT

Sparse FFT with frequency recovery, comparing against FFTW3

N=1,048,576 (1M samples). 1000/1000 recovery rate at all K.

K NSFFT (ms) FFTW (ms) Speedup
50.03629.2811x
100.92329.231.6x
200.95429.230.6x
g++ -O3 -march=native -std=c++17 nsfft.cpp -o bench && ./bench
→ Try it yourself

NSFix

FIX protocol parser with AVX2 SOH/EQ dual-scan

Test NS (msg/sec) QuickFIX (msg/sec) Speedup
Full engine (mmap+sessions+recovery) ~8.5M 452K ~18.8x
g++ -O3 -march=native -mavx2 -std=c++17 bench_nsfix.cpp -o bench && ./bench
→ Try it yourself

NSGraph

Community-structured graph reordering for locality

Graph NS (ms) Standard (ms) Speedup
Graph C (reordered) 107.4 266.0 (scrambled) 2.48x
g++ -O3 -march=native -std=c++17 nsgraph_bench.cpp -o bench && ./bench
→ Try it yourself

NSHash

Open-addressing hash map optimized for structured keys

11.76x vs absl::flat_hash_map (timestamp lookup). Cold-run medians, 1M keys.

Distribution/Test NS (ns/op) absl (ns/op) Speedup
Timestamp 1.62 19.09 11.76x
Sequential 8.52 19.38 2.28x
Bounded 1.19 10.14 8.53x
Sequential insert (1M keys) 7.04 ms 30.0 ms 4.26x

Sequential insert: 4.26x absl | 101x fph | 3.1x std, 142.0M ops/s.

g++ -O3 -march=native -std=c++17 bench.cpp -o bench && ./bench
→ Try it yourself

NSIndex

Spatial indexing with hybrid prediction dispatch

Operation NS (ns) Competitor (ns) Speedup
Predecessor 2.0 71.9 (lower_bound) 35.6x
Successor 2.9 71.3 (lower_bound) 24.5x
Insert 28.4 243.1 (std::map) 8.6x
g++ -O3 -march=native -std=c++17 nsindex_bench.cpp -o bench && ./bench
→ Try it yourself

NSLock

Reader-writer lock with AVX2 SIMD writer scan

Scenario NSRWLock std::shared_mutex Speedup
Pure read (256t, 100% readers) 25.42M ops/s 11.12M ops/s 2.29x
Mixed 95/5 (8t pinned) 7.17M ops/s 5.00M ops/s 1.43x

100M ops, pinned cores 0-7. Headline: 2.29x under pure-read load.

g++ -O3 -march=native -mavx2 -std=c++17 lock_bench.cpp -o bench && ./bench
→ Try it yourself

NSMatrix

Block-diagonal matrix operations with AVX-512

3.3x Eigen at B=1,000 blocks. Win condition: block-diagonal structure declared by caller.

Blocks NS (ns/block) Eigen (ns/block) Speedup
B=1,000 80.64 266.32 3.30x
B=10,000 157.64 363.51 2.30x
B=100,000 171.70 353.10 2.06x
g++ -O3 -march=native -std=c++17 bench_nsmatrix.cpp -o bench && ./bench
→ Try it yourself

NSMesh

3D mesh compression with parallelogram prediction

Compressor Size (bytes) Encode (ms) Speedup
NSMesh (Para+Delta+Zlib) 67,286 25 18.1x encode vs Draco
Draco cl 10 160,626 453 -
g++ -O3 -march=native -std=c++17 mesh_bench2.cpp -o bench && ./bench
→ Try it yourself

NSOptimize

Hierarchical TSP solver for routing problems

Cities NS (μs) 2-opt (μs) Speedup
20,000 49,727 17,777,548 357x
g++ -O3 -march=native -std=c++17 optimize_bench.cpp -o bench && ./bench
→ Try it yourself

NSPack

Transparent filesystem compression for mixed file types

File type Best alternative Alt ratio NSPack ratio Format preserved
SQLite databasesgzip1.8xup to 3914xYES (.sqlite)
HDR / EXR imagesOpenEXR DWAB~6x25xYES (.hdr / .exr)
3D mesh (procedural)Draco (Google)~5x8.82xYES (.obj / .ply)
3D mesh (OBJ / PLY)Draco (Google)~5x7.84xYES (.obj / .ply)
Point clouds / LiDARLASzip~3x5.68xYES (.ply)
Source code (AST)gzip1.2x5.01xYES (.py / .cpp)
BVH animationgzip1.5x4.35xYES (.bvh)
Scientific arraysgzip1.05x4.13xYES (.bin)
ELF binariesgzip1.06x2.90xYES (executable)
WAV audioFLAC (lossless)5x2.31xYES (.wav)
PNG / JPG imagesWebP~1.3x1.56xYES (.png / .jpg)
Pre-compressed (MP4, ZIP)N/A1.00x1.00xYES (pass-through)
nspack mount ~/assets ~/assets-store && nspack status ~/assets
→ Try it yourself

Linux / macOS (FUSE3), Windows (WinFSP)

NSQCD

Analytic QCD from first principles: no lattice, no GPU, no free parameters

Observable NSQCD Measured Error Status
m_gap (glueball)1.535 GeV1.500 GeV2.3%<5% PASS
Lambda_Nf3 (MSbar)0.349 GeV0.332 GeV5.0%<6% PASS
alpha_s(m_Z)0.11790.11790.0%<1% PASS
python3 nsqcd_cli.py --benchmark
→ Try it yourself

NSQueue

Lock-free MPMC queue with batch operations

Queue Throughput (M items/s) Latency (ns) Speedup
NSQueue 329.0 56.2 4.0x vs rigtorp
rigtorp::SPSCQueue 81.4 352.6 -
g++ -O3 -march=native -std=c++17 queue_bench.cpp -o bench && ./bench
→ Try it yourself

NSSort

Distribution-aware sort with counting sort fast path

Dataset: n=100M elements, int64_t. 8/10 wins vs IPS4o. Losses on structureless data only.

Distribution NS (ms) IPS4o (ms) Speedup
Zeros 0.001 182 182,000x
Sorted 52.9 787 14.9x
Reverse sorted 81.5 840 10.3x
Almost sorted 712 782 1.10x
Root dup 220 521 2.36x
Two dup 126 186 1.47x
Eight dup 135 243 1.80x
Zipf 249 418 1.68x
Exponential 2120 1107 1.91x Loss
Uniform 1232 808 1.52x Loss
g++ -O3 -march=native -fopenmp -std=c++17 NSSort.cpp bench_v10.cpp -o bench && ./bench
→ Try it yourself

NSSort GPU

GPU-accelerated sort with two-level MSD radix

Dataset: n=100M elements, int64_t. 1570x on zero distribution vs cub::DeviceRadixSort (RTX 2000 Ada).

Distribution NS (ms) cub::radix (ms) Speedup
Zeros 0.074 115.6 1570x
Sorted 3.93 116.3 29.6x
Reverse sorted 54.4 116.3 2.14x
Almost sorted 60.5 116.3 1.92x
Root dup 7.71 116.0 15.0x
Two dup 8.85 115.6 13.1x
Eight dup 7.52 115.6 15.4x
Zipf 9.00 115.7 12.9x
Exponential 117.6 116.4 1.01x Loss
Uniform 180.4 117.9 1.53x Loss
nvcc -O3 -arch=sm_70 -std=c++17 NSSort_GPU.cu -o bench && ./bench
→ Try it yourself

NSStringIndex

String search index for amortized queries

Scenario NS (ms) strstr (ms) Speedup
1000 queries 63.44 136,613.44 2153.5x
100 queries 61.89 13,447.00 217.3x
g++ -O3 -march=native -std=c++17 nsstringindex_bench.cpp -o bench && ./bench
→ Try it yourself

NS Suite - LLM

Inference and quantization for transformer workloads


NSAttend

Sparse attention with fixed-window and variable-length sequence support

Fixed window size: 512

seq_len NSAttend (ms) Dense (ms) Speedup
102410.1256.655.6x
204836.56244.406.7x
409664.58829.7512.9x
8192115.743320.3128.7x
g++ -O3 -march=native -std=c++17 nsattend.cpp -o bench && ./bench
→ Try it yourself

NSInfer

CPU inference engine with energy-ordered neuron selection

Method Time (ms) Speedup Memory
Dense BLAS baseline160.21.0x0.086 GB
NSInfer (75% energy, K=0)52.73.04x0.041 GB

3.04× MLP throughput · TinyLlama-1.1B · standalone

72B real-world: +70% prompt eval with --ns-infer on Qwen2.5-72B (A40)

Cosine similarity: 0.9693

g++ -O3 -march=native -std=c++17 nsinfer.cpp -o bench && ./bench
→ Try it yourself

NSKVCache

KV cache compression with cross-layer grouping and semantic deduplication

Stage Size (MiB) Cumulative Compression
Raw KV (fp16)125,0001.0x
Cross-layer grouping15,6258.0x
INT4 quantization3,90632.0x
Eviction (40% keep)1,56380.0x
Filler elimination938133.3x
Semantic dedup469266.7x
g++ -O3 -march=native -std=c++17 kv_box.cpp -o bench && ./bench
→ Try it yourself

NSQuant

Variable-rate per-cluster quantization with repacking for GEMV inference

Feature Value
Formats supportedQ4_K, Q8_0, IQ2_XXS
Hot weightsQ8_0 (top 5% by activation)
Warm weightsQ4_K (next 25%)
Cold weightsIQ2_XXS (remaining 70%)
Disk reduction7.2× measured · 10-12× with delta compression (not yet implemented)

Qwen2.5-3B · 6.18 GiB F16 → 1.61 GiB · 3.8× · coherent

Qwen2.5-72B · 140 GiB F16 → 19.4 GiB · 7.2× · coherent

Profiling: Wanda single-pass importance, 128 calibration samples. 72B profiles in ~6 minutes.

./nsquant <input.gguf> <output.nsm> [n_prompts [prompts.txt]]
→ Try it yourself