Closed rukai closed 2 weeks ago
Comparing rukai:java_interrop_wrapper
(44d5124) with main
(f53bf73)
⚡ 1
improvements
✅ 38
untouched benchmarks
Benchmark | main |
rukai:java_interrop_wrapper |
Change | |
---|---|---|---|---|
⚡ | encode_system.local_result_v5_no_compression |
105.5 µs | 93.3 µs | +13.12% |
The j4rs java interop crate is quite flexible but it allows for a few things which bring us no value:
Instance
and values that will be sent into javaInvocationArg
All of these features were causing great complexity for our java driver integration tests, so I introduced a wrapper that does not expose the above features. It reduces the lines of code used to implement the kafka java driver from 687 to 484. ( 30% reduction in lines) We should expect a similar reduction in complexity for the cassandra java driver. The wrapper completely wraps j4rs and we should not interact directly with j4rs in our driver logic anymore.
The new wrapper consists of 2 types:
Jvm
- wrapsj4rs::Jvm
Value
- wrapsj4rs::Instance
and additionally takes on the role ofj4rs::InvocationArg
While this wrapper is closely matched to our own needs and probably not upstreamable exactly as is. We might be able to see parts of it upstreamed either as an optional wrapper or integrated with the main API. Doing so would reduce the complexity of the wrappers implementation. But no hurry, we can land the wrapper as is for now.