Skip to content

Commit

Permalink
GH-41702: [C++][Parquet] Thrift: generate template method to accelera…
Browse files Browse the repository at this point in the history
…te reading thrift (#41703)

### Rationale for this change

By default, the Thrift serializer and deserializer call many virtual functions. However, the Thrift C++ compiler has an option to generate template methods that does away with the cost of calling virtual functions. It seems to make the metadata read/write benchmarks around 10% faster.

### What changes are included in this PR?

1. `cpp/build-support/update-thrift.sh`: enable `templates` option to Thirft C++ compilerargument
2. `cpp/src/parquet/thrift_internal.h`: use generated code
3. `cpp/src/generated`: update generated files.

### Are these changes tested?

Covered by existing tests.

### Are there any user-facing changes?

No.

* GitHub Issue: #41702

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
mapleFU authored May 22, 2024
1 parent 8967ddc commit 9ba9253
Show file tree
Hide file tree
Showing 5 changed files with 5,147 additions and 4,918 deletions.
2 changes: 1 addition & 1 deletion cpp/build-support/update-thrift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

# Run this from cpp/ directory. thrift is expected to be in your path

thrift --gen cpp:moveable_types -out src/generated src/parquet/parquet.thrift
thrift --gen cpp:moveable_types,templates -out src/generated src/parquet/parquet.thrift
Loading

0 comments on commit 9ba9253

Please sign in to comment.