Repository navigation
Replace Cython with nanobind - #717
Closed
adeebshihadeh wants to merge 2 commits into
Closed
adeebshihadeh wants to merge 2 commits into
adeebshihadeh wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
cp311wheel plus onecp312-abi3wheel 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)
send+recv, 64 Bsend+recv, 1 KiBsend+poll+recvreceive(non_blocking=True), emptyall_readers_updated()Cross-process 1 KiB ping-pong is identical within noise (~160k msgs/s for all three).
vs #716
nanobindas a build dependency, and builds its runtime into a static lib from SCons.sos are ~560 KB total vs ~200 KB for Replace Cython with the CPython limited API (abi3) #716 (~480 KB with Cython)boolarguments are strict (True/Falseonly), where Cython and Replace Cython with the CPython limited API (abi3) #716 accept any truthy value