Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Binary Reader Performance Refactor (#267)
* Binary Reader Performance Refactor This commit refactors the pure python (non-extension) binary reader to improve performance. My testing shows it to be roughly 2.5x faster for the streaming event API. The simpleion.loads has additional processing overhead that decreases the gains there. It ditches the coroutine dispatching overhead within the reader and replaces the stateful buffer with an immutable buffer that uses memoryviews to decrease memory allocations. The immutability of the buffer is less important for the binary reader but will be important for the text reader where we often need to look ahead. It contains a change to the IonThunkEvent that should have a positive impact on the text reader as well. More impactful will be to apply this pattern to the text reader. I left the managed_reader unchanged though de-coroutining that and minimizing managed event construction could yield more gains for both text and binary.
- Loading branch information