-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate Java 8 support and move to Java 11 #626
Comments
In a few days from now, Java 8 will officially be two LTS releases behind. I think the case of replacing OkHttp with the native HTTP client is a good example of the "price" we would pay if we decide to keep on supporting Java 8. I would be in favour of investigating if the native HTTP client is a suitable replacement for OkHttp. If so, I would vote to drop Java 8 support and set 11 as our new baseline. It's a big move, but we're not alone: Spring 6 will even have Java 17 as its baseline. A nice additional benefit we can get from this move is that it would also reduce our dependency footprint. This is what we currently add to any project that wants to use the Dapr SDK for Java, because of our dependency on OkHttp:
|
Have you run any relevant benchmarks against native HTTP client and OKHTTP? |
No. This replacement would be a follow up on this issue. This would be good data to have to decide on replacing it. If there is a performance penalty, might be worth keeping the OkHTTP dependency. |
How about this?
|
How about turning DaprHttp into an interface, creating two implementations, okhttp and "native" jdk 11 http client then writing / running a performance test using actors with jmh? |
I like the proposals above. Just be mindful that we cannot have client breaking changes in the SDK. |
To investigate if the Java HTTP client is a suitable replacement for OkHttp in terms of performance, I created a benchmark setup. For the setup I followed the suggestions of @mthmulders and @johnou. The setup is as follows:
I ran all the tests on my own machine (with a pretty good processor). So all performance tests ran very fast. I also tried it on a slower machine, which had a visible impact on the speed of the HTTP clients. But relatively this gave the same results. On my own machine this resulted in the following measurements:
I put the setup in a Git repository with clear instructions in the readme, so you can run the benchmark on your own machine too. |
This is excellent work @Juliandb1708. I think the perf difference does not justify adding a (potential) dependency conflict to the applications consuming this SDK. Thoughts? Vote 🎉 here to use Java HTTP Client. |
/assign |
Please, look at the partial work I have on this. It is moving to Java 11 and removing OKHTTP dependency: Pending work:
|
I can help with this issue if no one else is looking at it. I would propose to:
|
I just submitted a proposal to add jdk17 and springboot 3.0 to the dapr java sdk. One of the pending issues is whether continue to support java8. |
We now require JDK 11 as the minimum JDK version. |
Describe the proposal
Since we already have multiple releases of this SDK supporting Java 8, can we migrate to Java 11 as the minimum JDK version?
This might allow us to migrate to the native HTTP client and move out of OKHTTP, for example.
Also, we might consider adopting newer features available in the newer Java language version.
Please, vote with 👍 or 👎
The text was updated successfully, but these errors were encountered: