My Go vs Java preferences in favour of Go. Low cognitive overhead Goroutines Channels Answer from lickety-split1800 on reddit.com
🌐
Reddit
reddit.com › r/java › java performance vs go
r/java on Reddit: Java performance vs go
December 9, 2025 -

I'm seeing recurring claims about exceptional JVM performance, especially when contrasted with languages like Go, and I've been trying to understand how these narratives form in the community.

In many public benchmarks, Go comes out ahead in certain categories, despite the JVM’s reputation for aggressive optimization and mature JIT technology. On the other hand, Java dominates in long-running, throughput-heavy workloads. The contrast between reputation and published results seems worth examining.

A recurring question is how much weight different benchmarks should have when evaluating these systems. Some emphasize microbenchmarks, others highlight real-world workloads, and some argue that the JVM only shows its strengths under specific conditions such as long warm-up phases or complex allocation patterns.

Rather than asking for tutorials or explanations, I’m interested in opening a discussion about how the Java community evaluates performance claims today — e.g., which benchmark suites are generally regarded as meaningful, what workloads best showcase JVM characteristics, and how people interpret comparisons with languages like Go.

Curious how others in the ecosystem view these considerations and what trends you’ve observed in recent years.

🌐
Reddit
reddit.com › r/golang › go vs java
r/golang on Reddit: Go vs Java
May 27, 2025 -

Golang has many advantages over Java such as simple syntax, microservice compatibility, lightweight threads, and fast performance. But are there any areas where Java is superior to Go? In which cases would you prefer to use Java instead of Go?

Top answer
1 of 5
421
Java has a bigger, more mature ecosystem, due to being around since the mid 1990's. That's probably the main measurable thing that isn't just someone's opinion.
2 of 5
123
I come from a Java background but writing Go since a few years. Like both languages. Today I prefer Go over Java to do basically anything. That being said, I think Java’s stronger points are: No pointers. You still need to know the difference between primitives vs objects but you never see the pointer syntax and logic (For me they are completely fine, but I know some devs who find them confusing, never actually “got” them and never want to see them in code) Java frameworks, harnessing the power of reflection (basically the whole compile time info being there at runtime) work really magically. (I’m not a big fan of magic, don’t think they are worth the tradeoff, but they really make some things with very small amount of “tidy” code possible) Functional features, stream API etc. Very mature and solid frameworks and libraries. Some come to mind are Spring, Jackson, Guava (great stuff for caching in it), OkHttp, and various Apache libraries. Perfect developer tooling: IntelliJ Idea, debuggers, VisualVM and other profiling tools and so on (JVM makes a lot of things work “perfectly” there) Constructors making default values possible. Better relation with immutability. Many useful data structures in standard library. Some examples are: LinkedHashMap, TreeSet, ConcurrentMap and so on.
🌐
Reddit
reddit.com › r/golang › reasons you prefer golang over java?
r/golang on Reddit: Reasons you prefer Golang over Java?
May 17, 2023 -

Background: I've been using Java for about 8 years and just started learning Golang.

So far, I'm in love with the language, and these are the top reasons:

  • More low-level control of memory. I hated how much the JVM's GC relied on the compactor. Objects can only be created on the heap and object arrays are arrays of pointers to non-contiguous locations in memory. Many like to say that Java has better GCs than Go, but that's because Go's memory model doesn't require such complicated GCs. It's also nice to have pointers in Go.

  • More paradigm-neutral. Java was designed from the beginning to be a language primarily for OO programming. Using Java for functional programming results in unnatural syntax and inefficient use of memory. Golang feels ambidextrous.

I'm still very new to Golang but as of right now, I even see it as a replacement for Node and Python in the areas of scripting and web server development. Golang's fast compile time closes makes it competitive against interpreted languages in terms of development speed, but 1-ups these languages because it gives the developer more low-level control of memory and has static typing.

🌐
Reddit
reddit.com › r/golang › any idea why go is not massively overperforming java in this benchmark ?
r/golang on Reddit: Any idea why go is not Massively overperforming java in this benchmark ?
April 28, 2025 -

In this benchmarking test, Anton the youtuber is testing REST API built using Java (Quarkus) and Go (Fiber). I always thought that Go Massively outperforms other compiled and GC languages like java and C#. But according to this test, go barely outperforms java api. This test uses Fiber which uses fast http which is faster than the standard lib net/http. The benchmark uses two tests: 1). A simple get api which returns a UUID as json 2). An api which fetches a file from local computer, saves it to amazon S3 and then saves metadata to Postgres. The 2nd test is closer to real world use case. I am studying go and could use your comments to know what could Anton do to further optimize his go app. I know a performance gain of a few seconds doesn't matter. I am just curious.

🌐
Reddit
reddit.com › r/golang › what's the advantage of golang instead of java or c# in industry?
r/golang on Reddit: what's the advantage of golang instead of java or C# in industry?
March 18, 2021 -

I'm a student majoring in in CS and I'm interested in golang and learn it a little bit but I don't know what's the real advantage of it.

I think C# or java has better a framework now (for example Spring in java) and speed is fast enough.

and golang's orm isn't good so far.

If you guys work for company and use golang now, I want to know why you choose it.

** recently golang is frequently used in blockchain instead of C++. why?

Top answer
1 of 28
218
Go is nothing but Google's teaching from Java and C++. If you're majoring in CS, the language doesn't matter that much. But if you're working with industrial code in Java, C++ or even C#, you'll notice that code complexity increases over time due to the language design: Inheritance can lead to an absolute mess. In fact, a friend of mine quit his job partly because of overused inheritance in a legacy project. This is why Go favors "composition over inheritance". Those languages confuse repetition with safety. There's literally no point of writing FileReader fileReader = new FileReader();. Go addresses this issue with type inference, less keywords and by encouraging developers to indicate the scope of a variable with its length. Sure, the other languages mentioned have type inference as well, but there are orgs where you're not allowed to use it. :-) Especially Java uses layers and layers of abstraction, mostly introduced by frameworks like Spring. This is quite handy if you have a large team that just wants to add new features without having to wrap their heads around Dependency Injection, but debugging isn't that much fun and it obfuscates the control flow. By reducing abstractions to a minimum and providing a sane standard library (removing the need for monolithic frameworks), Go tries to gain back control. Compile times of 20, 30 or even 40 minutes are nothing unheard of. It is a pain, and it is a productivity killer - so Go favors compile times of 2, 3 or 4 seconds. Rob Pike did a great talk on his intentions when designing Go: "Public, Static, Void"
2 of 28
76
In my opinion, the major selling point of Go vs. Java and C# is running cost. Let me explain further in points form: Go consume very minimal memory. My web service run about 10MB to 20MB max. I can just use the cheapest VM available, e.g. 3.5USD AWS Lightsail and still have the resource to run other things in the same VM. This is one of the reason why Go is very popular in third world country like Indonesia and China because they can save a lot of money. At the same time, Go benchmark usually tops C# and Java (except against vert.x). Simple concurrency model that most people can understand. You don't have to hire experienced .NET or Java developer to maintain your code. Go build very fast, so if you're using build agents (e.g. Azure Dev-ooops), your build agent running cost will be very low and you don't have to deploy VM with crazy spec to back your build agent. Also, tests usually complete significantly faster compare to the equivalent Java/C# project, which again further reduce the cost of your build infrastructure. In summary, I'm poor and Go is the best tool for poor people like me without having to go through the pain of learning C++/Rust.
🌐
Reddit
reddit.com › r/java › java outperforming go on a simple benchmark
r/java on Reddit: Java Outperforming Go on a Simple Benchmark
June 20, 2024 -

Seems based on the sample code provided in the LINK, Go underperforms. Some interesting jvm optimization might be taking place.

SOLVED: The issue is that it was using 'int' and not 'long' in the Java code, which caused an integer overflow with high numbers, leading to the collatz function terminating incorrectly as indicated by the OP but java seems faster with a very small margin. LINK

Find elsewhere
Top answer
1 of 62
267
Super reliable runtime. It's extremely rare that we have to go back in the code and fix it up due to instability or performance reasons. Huge savings on RAM. Java eats memory like it's a cookie monster, which is a huge cost driver for us on EKS (we do a lot of data streaming, and the difference is night and day) Much eaiser for developers to run "the entire stack" locally on their machine. You can easily spin up a docker compose with say 10 microservices in go, no problem. With java services that always gets tricky, whether it's due to RAM or sluggishness or dependency issues Very easy for a team to collaborate on a project. You can just read the code, understand what it does and jump in to add features very easily. No need to digest an entire object inheritance graph. No need to search for the AbstractFactoryExecutorBean that actually **does the thing**. Very easy for anyone to just clone a project and start running tests, or run the whole project. Our JVM projects always have a ~30min to ~4hour startup time of "oh you have the wrong JDK on the path" or "Maven HTTP 401 Unauthorized", or "maven has installed the wrong version before you had to swap our the jdk for 1.8". The difference to golang is stark and very time saving in this respect. On the flip side, the JVM shines for big data processing. The type system is just much more advanced. And the runtime is more flexible in many ways. There's no "flink"/"spark" for golang. Yet.
2 of 62
256
No maven/gradle, no spring framework, fast start up time.
🌐
Reddit
reddit.com › r/golang › why is golang's performance worse than java's in this benchmark game?
r/golang on Reddit: Why is golang's performance worse than Java's in this benchmark game?
December 29, 2016 -

In the "binary trees benchmark" here http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=java

Go seems to underperform Java by quite a bit. Now I understand Go is much newer, but is there something in code (http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&lang=go&id=4) which slows it down or is it that the GC is still less mature than Java's?

I know it's just a game, but still...

Top answer
1 of 6
32

Yes, it is memory allocator and probably the fact that bottomUpTree() is called a lot, recursively.

That being said, making sweeping statements (like "Go's GC is immature") based on a single benchmark is not exactly right. Both Go and Java have state-of-the art garbage collectors but they are tuned for different scenarios and this benchmark has a workload that heavily favors Java's GC.

Why? Because Java's collector is generational. That means that allocation is extremely cheap (bump of the pointer). The downside is that generational GCs use more memory and when objects are moved from nursery to tenured heap, there's additional work of copying the memory.

Go's GC is not generational, so allocation requires (comparatively speaking) much more work. It's also tuned for low latency (smallest pause when GC has to stop the program) at the expense of throughput (i.e. total speed). This is the right trade-off for most programs but doesn't perform optimally on micro-benchmarks that measure throughtput.

I've made a Go version that allocates nodes in bulk https://gist.github.com/kjk/4620bf60315d3fdd3f210e4590bdf1cb using a pool allocator of nodes.

On my machine it goes from 17s to 9s (if I allocate 1024 nodes at a time) or 7s (if I allocate 32*1024 nodes at a time).

In this particular program the number of nodes could be calculated up-front so it could be sped up even more.

Another thing where Java probably has an advantage is the fact that almost all the time is spent calling bottomUpTree() a lot, recursively.

Why is it worse than in Java?

To make goroutines cheap, Go starts each goroutine with very small stack (~4kb). As a result, Go has to expand the stack when needed. Go does that by checking stack size at the beginning of every function call. When it detects it needs more stack, it creates a new, bigger stack and copies the old stack to new one.

The cost is usually very small (few instructions for each function call) but if there is a function like bottomUpTree() that does little work and is called very often, even small cost adds up.

Additionally, this is deeply recursive call, so stack is being copied several times when it needs to be expanded.

I'm pretty sure that if you rewrote bottomUpTree() to be non-recursive (non-trivial but possible) and used pool allocator for nodes, Go version would be as good (if not better) than Java.

2 of 6
4

The Alioth shootout is Lies, Damn Lies, and Statistics material. The results are — generally speaking — non-deterministic (e.g., suboptimal runtime settings on JVM that lead to non-repeatability) or specious (e.g., measuring the performance of Go, Ruby, or JVM callouts to native C libraries). I wish folks would quit citing them and formally label them harmful; they lack methodological rigor.

🌐
Reddit
reddit.com › r/experienceddevs › java vs golang
r/ExperiencedDevs on Reddit: Java vs GoLang
October 24, 2024 -

Hello experienced dev community,

I have 6 years of front end experience at big tech, start ups, as well the bank.

I want to transition into full stack or backend development , therefore I will be starting to learning backend tech stacks outside of work hours.

My friends suggested either Java + spring or GoLang. Apparently Java has the most mature platform and best overall supported ecosystem. As well, from landing a job perspective, most enterprise uses Java. However, he said golang is getting popular and the golang community is very motivated, although Go is utilized to write dev op tools like Terraform.

My goal is to intensively study and build a decent backend heavy project and hopefully transition into full stack / backend developer roles in 6 months.

Should I start go all in on Java?

🌐
DZone
dzone.com › data engineering › data › is java really faster than go?
Is Java Really Faster Than Go?
May 5, 2021 - As the Reddit /r/java and YouTube comments suggest, For most tasks Java and Go are completely fine performance-wise. However, I did find Java quite unwieldy, with proponents mandating warm up time for Java, which would certainly result in a ...
🌐
Reddit
reddit.com › r/golang › what go does better than java and reverse from your experience?
r/golang on Reddit: What Go does better than Java and reverse from your experience?
May 1, 2017 -

I've started to learn Java mainly because Android development is based on it. I'm not really familliar with it, but I've a c++ background that might give me some ideas. What I'm really looking to know is where I should use Java instead of Go. There's some fields below that I'm interested in and wanna hear your opinions as well:

a) Mobile Development

b) Web Development

c) Games Development

d) Scientific Development

e) GUI Development

f) New field..

If you're familliar with both languages and wanna give me your opinion would be awesome!

Note that I'm not looking to switch or give up one language in favor of another, but wanna learn to use them where they fits the best.

🌐
Reddit
reddit.com › r/golang › go vs java for service oriented architecture supporting large scale website
Go vs Java for service oriented architecture supporting large scale website : r/golang
August 4, 2016 - You'll find a library to generate PDFs in Java but is highly unlikely that you'll find a mature library for PDFs in go. It's an example that I'm making up, but if your doing micro services , that would probably a service itself. If I needed top notch performance I would go for Java too; if you're into tweaking the GC that's something you cannot do in go.
🌐
Medium
medium.com › @mohnisha › java-vs-golang-performance-testing-4d0d6a5123fb
Java vs Golang Performance Testing | by Mohnish Aggarwal | Medium
November 11, 2025 - To understand the difference in performance between each language, we should first understand the basics of how each language operates. Java is statically type and both a compiled / interpreted language. Java code is first compiled into bytecode which is platform independent and runs on the Java Virtual Machine (JVM).
🌐
Google Groups
groups.google.com › g › golang-nuts › c › G8L4af-Q9WE
Google paper comparing performance of C++, Java, Scala, and Go
On Fri, Jun 3, 2011 at 12:47, Jeroen Dirks <jeroen....@gmail.com> wrote: > The paper just hit the Reddit front page. I was a bit surprised about > the amount of memory used > by the Go solution. Would it have been possible to create less garbage > to start with? The program is not using appreciably more memory than C++ dbg or Java.