Skip to content

Replace Cython with nanobind - #717

Closed
adeebshihadeh wants to merge 2 commits into
masterfrom
nanobind
Closed

adeebshihadeh wants to merge 2 commits into
masterfrom
nanobind

Conversation

@adeebshihadeh

@adeebshihadeh adeebshihadeh commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Alternative to #716: same goal (drop Cython), using nanobind instead of the raw CPython C API. Same public API, module names, and small behavior changes as #716, so the two can be compared directly.

nanobind's stable ABI needs Python >= 3.12, so wheels are one cp311 wheel plus one cp312-abi3 wheel per platform. The abi3 wheel passes the full test suite on 3.12, 3.13 and 3.14, and the cp311 wheel on 3.11.

Benchmark (in-process, ns/op, best of 3, pinned core)

Cython (master) C API (#716) nanobind (this PR)
send + recv, 64 B 2706 2609 2697
send + recv, 1 KiB 2815 2718 2806
send + poll + recv 2957 2731 2821
receive(non_blocking=True), empty 56 21 31
all_readers_updated() 19 17 24

Cross-process 1 KiB ping-pong is identical within noise (~160k msgs/s for all three).

vs #716

@adeebshihadeh
adeebshihadeh deleted the nanobind branch October 25, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant