Skip to content

🧩HilbertSFC

Ultra-fast 2D & 3D Hilbert space-filling curve encode/decode kernels for Python.

2D Hilbert curves for nbits 1..5 3D Hilbert curves animation grid for nbits 1..4

2D Hilbert curves (nbits 1..5) and 3D Hilbert curves (nbits 1..4, animated).


This project is performance-first and implemented entirely in Python. The hot kernels are JIT-compiled with Numba and tuned for:

  • Branchless, fully unrolled inner loops
  • SIMD via LLVM vector intrinsics
  • Small, L1-cache-friendly lookup tables (LUTs)
  • Reduced dependency chains for better ILP, e.g., state-independent gather
  • Optional multi-threading for batch operations

It provides both convenient Python APIs and kernel accessors designed to be embedded into other Numba kernels.

Quick start

Start here: Quick start

API reference

For kernel accessors, cache helpers, and typing aliases, use the navigation bar.