cobs-python
cobs-python copied to clipboard
Improve performance of Python fallback on PyPy by ~20x
Whenever you call .cast() on a memoryview in PyPy, it will perform two allocations per iteration in order to map the underlying storage to the requested type. This happens even if the types are the same. I've added a check to avoid this for the common case of passing in a memoryview[bytes].