Some notes on your java impl:

You really want to use a framework for handling the connections and threading, 
its tricky in java.
Your current implementation creates 2 new threads on each connection which is 
wasteful and very expensive.

For threading please see:
https://stackoverflow.com/questions/5483047/why-is-creating-a-thread-said-to-be-expensive

You would either use:
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html
or
go for https://netty.io/.

For TLS

Java's implementation is unfortunately slow :(. 
(https://nbsoftsolutions.com/blog/the-cost-of-tls-in-java-and-solutions)
The solution is to either use something like HAproxy or try and use native ssl 
libraries, https://netty.io/wiki/forked-tomcat-native.html.

For a fairer comparison please do a rerun with the latest jre 11 and the 
threads being created in a global Executor service
 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to