Commit 84ced63
committed
Optimize type conversion between Python and Erlang
- Use enif_is_identical for atom comparison instead of strcmp
- Use PyLong_AsLongLongAndOverflow to avoid exception machinery
- Cache numpy.ndarray type at init for fast isinstance checks
- Stack allocate small tuples/maps (≤16 elements) to avoid heap alloc
- Use enif_make_map_from_arrays for O(n) map building vs O(n²) puts
- Add UTF-8 decode with bytes fallback for invalid sequences
- Reorder type checks for web workloads (strings/dicts first)
- Add ATOM_NIL for Elixir nil compatibility1 parent 21ce626 commit 84ced63
3 files changed
Lines changed: 261 additions & 116 deletions
0 commit comments