Skip to content

Add Cython-accelerated row-batch decoding - #206

Open
TheDistributor wants to merge 1 commit into
masterfrom
mgallwey/cython-decode-acceleration
Open

Add Cython-accelerated row-batch decoding#206
TheDistributor wants to merge 1 commit into
masterfrom
mgallwey/cython-decode-acceleration

Conversation

@TheDistributor

@TheDistributor TheDistributor commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Add Cython-accelerated row-batch decoding

Compiles the server result-batch decode loop (pynuodb/_fetch.pyx) to
C via Cython, replacing the pure Python per-row/per-column dispatch
in EncodedSession.fetch_result_set_next(). If the cython library is not
available at run time or if compiler tools are not available at package
build time, it gracefully falls back to the python native version.

Many tests added to test that it produces byte-identical output to the
native python version, and for many pathological cases.

Benchmark results compared to master:

========================= 9 passed in 79.98s (0:01:19) =========================
Test                                      master min (ms)  branch min (ms)     delta (ms)    delta %
----------------------------------------------------------------------------------------------------
test_fetchall_binary_types                         10.256            3.073         -7.183    -70.04%
test_fetchall_large                                77.005            6.123        -70.882    -92.05%
test_fetchall_mixed_types                         416.255          125.674       -290.581    -69.81%
test_fetchall_small                                 3.884            0.371         -3.513    -90.45%
test_fetchall_wide                                 47.262            2.129        -45.133    -95.50%
test_fetchmany_large                               76.295            6.306        -69.989    -91.73%
test_fetchone_loop_large                           84.153           11.685        -72.468    -86.11%
test_insert_large                                 184.796          185.560         +0.763     +0.41%
test_insert_small                                  12.428           12.479         +0.051     +0.41%

Insert related improvements will come in a subsequent commit.

@TheDistributor TheDistributor changed the title Test Add Cython-accelerated row-batch decoding Sep 10, 2026
@TheDistributor
TheDistributor marked this pull request as ready for review September 10, 2026 16:02
@TheDistributor TheDistributor self-assigned this Sep 10, 2026
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