On Tuesday, October 30, 2018 at 8:39:03 AM UTC-4, Gerrit Jansen van Vuuren wrote: > > 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 > > > Framework + framework + ... + 3rd-parth library + 3rd-parth library + ... Ah, this is why I escaped away from Java. I am willing to use Go for my new projects, even if Go is slower.
See NATS server and client's dependencies: https://godoc.org/github.com/nats-io/gnatsd/server?imports https://godoc.org/github.com/nats-io/go-nats?imports Almost all of them are std libraries. -- 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.