SIMD STRING MATCHING CJK WITHOUT UTF-8

Make strings
agree. Fast.

Fuzzy matching and sequence alignment with first-class CJK. Python’s UCS-2 and UCS-4 string objects go straight to SIMD—no UTF-8 representation, no transcoding detour.

PYTHON STRUCS-2 / UCS-4SIMD
  • Apache 2.0
  • Python 3.12+
  • Native UCS-2 / UCS-4 SIMD
ENGLISH ALIGNMENT / LIVE KERNEL MATCHED
NORMALIZED SCORE 0.9907
QUERY56 chars
In the beginning···heavens
In the beginning···heaven
TARGET55 chars
KERNEL smith_waterman_normalized_score AUTO SIMD
1.68×

overall geomean vs Parasail
Intel / AVX-512 / 80 rows

79/80

comparable rows won vs Parasail
Intel / AVX-512

1.88×

path and CIGAR geomean
32/32 wins vs Parasail

1.55×

Chinese-text geomean vs Parasail
CJK / 39 of 40 rows won

01 / WHAT IT DOES

Stop assembling a string stack out of six libraries.

Use the same fast, consistent API from typo-tolerant search to biological alignment. Batch paths prepare the query once, release the GIL, and keep the SIMD lanes busy.

02

SEQUENCE ALIGNMENT

Local or global. Linear or affine gaps.

Smith–Waterman and Needleman–Wunsch with score-only paths, traceback, CIGAR output, and built-in biological matrices.

Explore alignment
03

NAMES + RECORDS

Match how it sounds, not only how it is spelled.

Soundex, Metaphone, NYSIIS, Caverphone, Cologne, Daitch–Mokotoff, and Beider–Morse live beside the distance functions.

Explore phonetics
04

TIME SERIES

Align signals when time itself drifts.

Dynamic Time Warping for audio, sensors, gestures, and financial series, with batched distances and optional Sakoe–Chiba bands.

Explore DTW

02 / ONE ENGINE

Write the obvious Python.
Let the dispatcher sweat.

YOUR CODE import stride_align as sa
01x86AVX2 / AVX-512 / AVX10
02ARMNEON / SVE
03LoongArchLSX / LASX
04POWERVSX
05Scalarportable fallback
UNICODE WITHOUT THE DETOUR

UCS-2 and UCS-4 are first-class SIMD targets.

Developers do not have to encode Python strings into UTF-8 representations before alignment. Chinese, Japanese, Korean, Arabic, and emoji use direct UCS-1, UCS-2, or UCS-4 access and stay on the vectorized path.

ONE QUERY × MANY TARGETS

Batch work is the primary path.

Reuse the prepared query profile across candidate lists, or run full all-pairs cdist with thresholds, pruning, and per-query top-k.

03 / MOVE EXISTING CODE

One import away means one import away.

Keep familiar APIs while moving the work onto stride-align’s kernels. Native code should use stride_align directly; existing code can take the short road.

See compatibility details
migration.py
# before
import rapidfuzz

# after
import stride_align.rapidfuzz as rapidfuzz
rapidfuzz TheFuzz parasail jellyfish

04 / PROOF, NOT VIBES

Every fast claim comes with a workload.

The benchmark suite spans architectures, algorithms, text types, score widths, and comparison libraries. Reports include the context behind the headline, including regressions and correctness tradeoffs.

Open benchmark ledger
INTEL X86 / AVX-512 VS PARASAIL GEOMEAN · HIGHER IS BETTER
NW path8 / 8 wins
2.356×
NW CIGAR8 / 8 wins
2.341×
SW score16 / 16 wins
1.989×
All workloads79 / 80 wins
1.682×

Fresh July 18 rerun; bars use a linear scale relative to NW path. The 80-row sweep covers English and Chinese, linear and affine scoring, 16- and 32-bit widths, and both 1:1 and 1:many shapes against Parasail 1.3.4.

05 / START HERE

From zero to matching in two lines.

$ pip install stride-align
import stride_align as sa

score = sa.smith_waterman_normalized_score(
    "In the beginning… the heavens and the earth.",
    "In the beginning… the heaven and the earth.",
)

print(score)  # 0.9907407407407407