You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a ThriftProtocolError to avoid allocating and formattings strings for error messages (#8636)
# Which issue does this PR close?
This is a small performance improvement for the thrift remodeling
- Part of #5853.
# Rationale for this change
Some of the often-called methods in the thrift protocol implementation
created `ParquetError` instances with a string message that had to be
allocated and formatted. This formatting code and probably also some
drop glue bloats these otherwise small methods and prevented inlining.
# What changes are included in this PR?
Introduce a separate error type `ThriftProtocolError` that is smaller
than `ParquetError` and does not contain any allocated data. The
`ReadThrift` trait is not changed, since its custom implementations
actually require the more expressive `ParquetError`.
# Are these changes tested?
The success path is covered by existing tests. Testing the error paths
would require crafting some actually malformed files, or using a fuzzer.
# Are there any user-facing changes?
The `ThriftProtocolError` is crate-internal so there should be no api
changes. Some error messages might differ slightly.
0 commit comments