[C++][Java] Arrow Flight C++/Java performance comparison
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
Hi
I'm trying to understand difference in performance of Arrow Flight for C++ and Java. I run benchmarks for both languages and got the ~20x throughput difference.
Benchmark parameters:
- threads/streams: `16/16`
- batch size: `8192`
- records per stream: `10_000_000`
- network: `localhost`
Hardware:
CPU: 2x Intel(R) Xeon(R) Platinum 8352Y CPU @ 2.20GHz
RAM: 512GB
C++(`arrow/flight/flight_benchmark.cc`)
```
Testing method: DoGet
Using spawned TCP server
Server running with pid 382642
Server host: localhost
Server port: 31337
Server host: localhost
Server port: 31337
Number of perf runs: 10
Number of concurrent gets/puts: 16
Batch size: 262080
Batches read: 195360
Bytes read: 51200000000
Nanos: 2453011703
Speed: 19905.4 MB/s
Throughput: 79640.9 batches/s
Latency mean: 174 us
Latency quantile=0.5: 95 us
Latency quantile=0.95: 546 us
Latency quantile=0.99: 1920 us
Latency max: 147827 us
```
Java(`flight-core/src/test/java/org/apache/arrow/flight/perf/TestPerf.java`)
```
Transferred 160000000 records totaling 5120000000 bytes at 641.102193 MiB/s. 21007636.651566 record/s. 2565.032435 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 582.299625 MiB/s. 19080794.111082 record/s. 2329.764961 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 848.258903 MiB/s. 27795747.747999 record/s. 3393.860800 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 896.877756 MiB/s. 29388890.295311 record/s. 3588.383505 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1292.493243 MiB/s. 42352418.587486 record/s. 5171.230310 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1003.844027 MiB/s. 32893961.061297 record/s. 4016.352646 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1065.951924 MiB/s. 34929112.654969 record/s. 4264.844655 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1463.970739 MiB/s. 47971393.190316 record/s. 5857.307109 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1229.642808 MiB/s. 40292935.524028 record/s. 4919.767427 batch/s.
Transferred 160000000 records totaling 5120000000 bytes at 1297.904113 MiB/s. 42529721.971291 record/s. 5192.879053 batch/s.
Summary:
Average throughput: 1032.234533 MiB/s, standard deviation: 278.068050 MiB/s
```
Is it expected throughput difference? Can Java Flight server somehow be tuned in order to be more close to C++ version?
Contributor guide
Research direction
Compare the benchmark setup in arrow/flight/flight_benchmark.cc with flight-core/src/test/java/org/apache/arrow/flight/perf/TestPerf.java, starting with their concurrency, batch size, records, and transferred bytes. Reproduce both runs under matching parameters and determine whether the throughput gap is expected or whether Java Flight tuning is needed; document the findings and any supported tuning guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, java
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100