The GitHub Actions job "npm_and_yarn in /javascript for minimatch - Update 
#1264019228" on fory.git/main has failed.
Run started by GitHub user dependabot[bot] (triggered by dependabot[bot]).

Head commit for run:
9f2b6af4ad669cb08f5a065fd43412cf770a83dd / Shawn Yang <[email protected]>
perf(python): optimize pyfory collection serialization performance (#3441)

## Why?

Pyfory collection serialization hot paths still had avoidable
Python/Cython overhead and fragile ref-tracking behavior for mixed-type
collections and invalid ref IDs. This PR refactors the Python C++ shim
location, consolidates Buffer ownership under `serialization`, and adds
fast paths plus regression coverage to improve performance and harden
correctness.

## What does this PR do?

- Move the Python C++ shim from `cpp/fory/python/*` to
`python/pyfory/cpp/*` and update Bazel targets/deps accordingly.
- Remove the standalone `pyfory.buffer` extension and inline `Buffer`
implementation into `serialization` (`buffer.pyx` -> `buffer.pxi` +
`serialization.pxd`), then migrate imports to `from pyfory.serialization
import Buffer` while keeping `pyfory.Buffer` exported.
- Add C++ primitive collection fastpath APIs
(`Fory_PyPrimitiveCollectionWriteToBuffer` /
`Fory_PyPrimitiveCollectionReadFromBuffer`) plus shared helpers for
internal type-id checks and fastpath eligibility.
- Optimize list/tuple/set/map Cython collection
serialization/deserialization paths (raw sequence-item access, same-type
fastpath dispatch, removal of dead `is_py` branches) and route primitive
same-type paths through the new C++ fastpath.
- Harden ref tracking and type resolution behavior: replace assert-based
invalid ref handling with `ValueError`, preserve slot semantics for
`REF_VALUE_FLAG`, and avoid mixed-type ref fastpath bypasses that can
break alias resolution.
- Expand benchmark tooling (`benchmarks/python/fory_benchmark.py`) with
`roundtrip|serialize|deserialize` modes and optional `msgpack` baseline.
- Add `python/pyfory/tests/test_ref_tracking.py` with edge-case coverage
for shared references, cycles, invalid ref IDs, and primitive fastpath
mutation safety.

## Related issues

N/A

## Does this PR introduce any user-facing change?

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

Added benchmark harness improvements (operation modes and msgpack
baseline); benchmark numbers are not included in this PR description.

Report URL: https://github.com/apache/fory/actions/runs/22557449703

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to