Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise CodedOutputStream.ArrayEncoder.writeFixed32NoTag/writeFixed6…
…4NoTag On Android, this generates better assembly code, bounds-checking through all the used indices upfront, and branching to deoptimise if it's not true, avoiding doing 4x bounds checks. We also don't generate 4 different `pThrowArrayBounds` code sections. https://godbolt.org/z/Kbhvcdvbd Code size Comparison: - `void X.writeFixed32NoTag__before(int) [292 bytes]` - `void X.writeFixed32NoTag__after(int) [180 bytes]` This starts by throwing a more meaningful length (4bytes or 8bytes for fixed64), which makes sure the value of position in the catch clause isn't dependent on which line threw the exception. PiperOrigin-RevId: 678543462
- Loading branch information