jhorstmann opened a new pull request, #5909:
URL: https://github.com/apache/arrow-rs/pull/5909
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
An alternative implementation of a custom thrift decoder, this time based on
rust declarative macros instead of a separate code generator.
Fixes #5854, Alternative to #5869
# Rationale for this change
The current thrift definitions are not easy to customize and also leave some
performance on the table. The macro-based approach here allows renaming fields
and replacing types with custom implementations, while still being relatively
easy to update.
The downsides of the macro is that error messages in case of typos are not
that easy to deciper. Once there are more customizations, updates would need to
be done via diff with the official definitions.
Even without customizations like borrowing data, the performance improvement
is significant. On my machine, with `native` target and still the default
allocator:
```
open(default) time: [9.9190 µs 9.9540 µs 9.9881 µs]
change: [-33.053% -32.672% -32.380%] (p = 0.00 <
0.05)
Performance has improved.
open(page index) time: [437.81 µs 439.01 µs 440.28 µs]
change: [-26.632% -26.481% -26.313%] (p = 0.00 <
0.05)
Performance has improved.
```
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
Replaces the thrift structures and custom protocol with a macro that wraps
the nearly unmodified `parquet.thrift` definitions.
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
This should mostly be a drop-in replacement, customizations and
optimizations could be done in future PRs, for example borrowing data or
replacing a `Vec<Encoding>` with a small bitset.
One api change is that structs and enum no longer derive the `Eq` trait,
only `PartialEq`.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking
change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]