Skip to content

v1.2.1: fix two more byte-by-byte IPC copy loops

Choose a tag to compare

@Mosaad-M Mosaad-M released this 29 Sep 13:26
· 7 commits to master since this release

Performance fix

Found via real sample-based profiling of a downstream consumer (hl7-arrow),
not guessed: encode_ipc_message's body-copy loop and decode_ipc_message's
metadata+body copy loops (the latter called from encode_arrow_file's
per-batch loop purely to re-derive a length) together accounted for 53.8%
of all real work in that pipeline once message bodies got large.

Same class of bug fixed before in this repo (v1.1.2, v1.1.3) -- these two
spots were missed until a real consumer's payload sizes made them dominant.

Real, isolated benchmark improvement:

  • encode_ipc_message: ~4.8x faster
  • decode_ipc_message: ~5.0x faster
  • encode_record_batch (100k rows): ~5.0x faster
  • decode_record_batch (100k rows): ~7.6x faster
  • encode_arrow_file (100k rows): ~5.3x faster

Verified against real pyarrow.feather.read_table() on a 50,000-row,
~9.9MB payload.

63/63 tests pass, zero breaking changes.