🌐
Medium
medium.com › deno-the-complete-reference › go-vs-java-native-http-server-performance-comparison-for-hello-world-case-2e30b5ec18ec
Go vs Java: Native HTTP server performance comparison for hello world case | Tech Tonic
April 18, 2023 - Well, Go’s native HTTP server turns out to be way faster than Java’s native server. The difference is pretty significant whether it’s RPS, latency or system resources. Regarding system resources, Go’s CPU usage is pretty high.
🌐
Toptal
toptal.com › back-end › server-side-io-performance-node-php-java-go
Server-side I/O Performance: Node vs. PHP vs. Java vs. Go | Toptal®
May 31, 2023 - But these are not as common as ... servers using such approaches would need to be taken into account. Not to mention that your code must be structured in a way that works with such environments; your “normal” PHP or Java web application usually will not run without significant modifications in such an environment. As a comparison, if we consider a few significant factors that affect performance as well as ease of use, we get this: Threads are generally going to be much ...
Discussions

Webserver Benchmark: Erlang vs Go vs Java vs NodeJS - Chat / Discussions (archived) - Elixir Programming Language Forum
In this article, we compare the performance of webservers commonly used to implement server-side applications. We look at webservers implemented in Erlang, Go, Java (OpenJDK), and JavaScript (NodeJS) · Hi, Interesting findings. But maybe next time you can create a simple todo list with sort ... More on elixirforum.com
🌐 elixirforum.com
7
January 7, 2020
go - Speed of Golang Vs Java - Stack Overflow
I have written a program in Java and equivalent in Go. My java program is taking around 5.95 seconds to execute while Go program is taking around 41.675789791 seconds. While speed of Go is comparab... More on stackoverflow.com
🌐 stackoverflow.com
Reasons you prefer Golang over Java?
My Go vs Java preferences in favour of Go. Low cognitive overhead Goroutines Channels More on reddit.com
🌐 r/golang
260
231
May 17, 2023
Kotlin vs Go

While the Go language is great, the go ecosystem is... strongly opinionated, not always for the best. One example: It’s taken years to acknowledge they need better package management and versioning, which is something that’s existed in pretty much all other language ecosystems for a long time.

With Kotlin, you can rely on a very mature and broad JVM ecosystem. Or roll your own. I end up doing a mix of both depending on the problem.

The only drawback for Kotlin IMO is serverless application development. It’s a little easier to throw together serverless apps using Go since you don’t deal with JVM warm up and huge package sizes. But it’s not a deal breaker.

More on reddit.com
🌐 r/Kotlin
50
24
December 26, 2018
🌐
Programming Language Benchmarks
programming-language-benchmarks.vercel.app › go-vs-java
Go VS Java benchmarks, Which programming language or compiler is faster
benchmarks,benchmark,performance,binarytrees,coro-prime-sieve,edigits,fannkuch-redux,fasta,helloworld,http-server,json-serde,knucleotide,lru,mandelbrot,merkletrees,nbody,nsieve,pidigits,regex-redux,secp256k1,spectral-norm,Go,Go lang,Java,Java lang
🌐
Stressgrid
stressgrid.com › blog › webserver_benchmark
Webserver Benchmark: Erlang vs Go vs Java vs NodeJS
January 10, 2020 - Go’s built-in webserver peaked slightly above 120k, NodeJS cluster at 90k, Erlang-based Cowboy 1.x at 80k. In the 50-60k range, we have another Erlang-based webserver, Mochiweb, then Cowboy 2.x, and Java-based Rapidoid. Finally, non-clustered NodeJS scored 25k. Clustered NodeJS and Rapidoid both crashed by running out of RAM once overloaded. Other servers, when overloaded, maintained their peak performance except for Mochiweb.
🌐
BMC Software
bmc.com › blogs › go-vs-java
Java vs Go: What’s The Difference?
Go is faster than Java on almost every benchmark. This is due to how it is compiled: Go doesn’t rely on a virtual machine to compile its code. It gets compiled directly into a binary file.
🌐
Proxify
proxify.io › articles › go-vs-java-performance
Go vs Java performance comparison
February 23, 2020 - For web services where speed and efficient resource utilization are paramount, Go's lightweight threads and fast execution often give it an edge in side-by-side comparisons with Java.
🌐
DZone
dzone.com › coding › java › when to use go vs. java | one programmer’s take on two top languages
When to Use Go vs. Java | One Programmer’s Take on Two Top Languages
August 5, 2020 - Working at a Golang web development company has clearly shown me that Go is fast, robust, and easy to understand which makes it very good for small services and concurrent processing. For large, intricate systems, services with more complex functionality, and single-server systems, Java will hold its own among the top programming languages in the world for the time being.
Find elsewhere
🌐
Timyang
timyang.net › programming › c-erlang-java-performance
C, Erlang, Java and Go Web Server performance test – 后端技术 by Tim Yang
Nov 12, change nginx.conf work_connections from 1024 to 10240 Nov 13, add runtime.GOMAXPROCS(8); to go’s code, add sysctl -p env Nov 18, realized that ApacheBench itself is a bottleneck under 1,000 or 5,000 threads, so use 3 clients from 3 different machines to redo all tests of 1,000 and 5,000 concurrent tests. Nov 24, use Netty with full HTTP implementation to replace Mina 2 for the Java web server.
🌐
Elixir Forum
elixirforum.com › erlang & beam forum (archived) › chat / discussions (archived)
Webserver Benchmark: Erlang vs Go vs Java vs NodeJS - Chat / Discussions (archived) - Elixir Programming Language Forum
January 7, 2020 - In this article, we compare the performance of webservers commonly used to implement server-side applications. We look at webservers implemented in Erlang, Go, Java (OpenJDK), and JavaScript (NodeJS) · Hi, Interesting findings. But maybe next time you can create a simple todo list with sort ...
🌐
EDUCBA
educba.com › home › software development › software development tutorials › top differences tutorial › go vs java
Go vs Java | Know The Top 8 Most Important Differences
January 11, 2024 - Being an Object-Oriented Programming Language, Java develops the OOP application relatively easier than Go and other programming languages. Java advances the extensibility and flexibility of the system and makes it modular. Java Doesn’t have many implementation dependencies. Network portability is a feature of Java programs. Java objects don’t include any references to outside data. Executing on the client instead of the server enables Java-based websites and applications to run faster than any other programming language.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Medium
arthuracosta.medium.com › benchmarking-golang-and-java-concurrency-performance-analysis-for-file-consumption-563105ae028b
Benchmarking Golang and Java: Concurrency Performance Analysis for File Consumption | by Arthur Costa | Medium
June 3, 2023 - All of you are tired of wondering about the big difference between Java and Golang but I will just give you a brief that is necessary for all of us to be on the same page. I could spend some time explaining the difference between syntax and bla bla bla, but what matter is: JVM — Golang does not have a JVM that will interpret your code and improve the performance during the runtime as Java does with JVM (JIT and JNI).
🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › technology comparison
An Informative Guide on Golang vs Java Comparison in 2026
January 2, 2026 - When talking about the application, both the programming have their own set of applications to which they are widely suitable; however, considering Golang for microservices and web services as it has a smaller memory footprint and a quicker start time. However, Java is ideally suited for building complex systems, particularly those dependent on one server.
🌐
Medium
medium.com › @mohnisha › java-vs-golang-performance-testing-4d0d6a5123fb
Java vs Golang Performance Testing | by Mohnish Aggarwal | Medium
November 11, 2025 - This could explain the differences in the first test where Java’s performance greatly improved over time. The downside to Java is its very resource intense. Go’s Goroutines are very lightweight in comparison to Java and nonblocking for I/O. Additionally, Go has a far smaller runtime environment, providing less overhead at runtime. We saw these differences in the second test as Go utilized a fraction of the resources Java utilized. I believe for standard web APIs, the choice between Go and Java ultimately comes down to programming preferences.
Top answer
1 of 4
18

(With tips from above answers, I did more test, with an additional C and V version)

On my Linux machine, with times = 100000000.

Testing result:

  • When exponent = 2.4
 Java: result: 1.053906e+24, during: 7432 ms
    C: result: 1.053906e+24, during: 5544 ms
   Go: result: 1.053906e+24, during: 8.716807708s
    V: result: 1.053906e+24, during: 2.342s
  • When exponent = 2, still use pow() or Pow().
 Java: result: 1.543194e+21, during: 630 ms
    C: result: 1.543194e+21, during: 852 ms
   Go: result: 1.543194e+21, during: 3.336549272s
    V: result: 1.543194e+21, during: 128.160ms
  • When exponent = 2, but use x * x instead.
 Java: result: 1.543194e+21, during: 636 ms
    C: result: 1.543194e+21, during: 340 ms
   Go: result: 1.543194e+21, during: 115.491272ms
    V: result: 1.543194e+21, during: 122.283ms

Summary:

  • In general, Go is really fast, according to the last test, faster than Java, or even C.
  • But, Java really has a good pow() implementation, according to the first two tests.
  • V, a new language similar to Go in some way, is very fast.

Code

Test.java:

/**
 * Compile:
 *  javac Test.java
 * Run:
 *  java Test
 */ 
public class Test {
    public static void main(String[] args) {
        Test test = new Test();
    long startAt = System.currentTimeMillis();
        double re = test.testFun(10, 16666611, 100000000);
    long during = System.currentTimeMillis() - startAt;
        System.out.printf("%10s: result: %e, during: %d ms\n", "Java", re, during);
    }

    private double testFun(double first, double second, long times) {
        int i = 0;
        double result = 0;
        double dx = (second - first) / times;
        for (; i < times; i++) {
            result += fun(first + i * dx);
        }
        return result * dx;
    }

    private double fun(double v) {
        return v * v - v;
        // return Math.pow(v, 2) - v;
        // return Math.pow(v, 2.4) - v;
    }
}

test.c:

/**
 * compile with:
 *  gcc test.c -lm
 */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

double fun(double v) {
    return v * v - v;
    // return pow(v, 2) - v;
    // return pow(v, 2.4) - v;
}

double testFun(double first, double second, long times) {
    int i;
    double result = 0;
    double dx = (second - first) / times;
    for (i = 0; i < times; i++) {
        result += fun(first + i * dx);
    }
    return result * dx;
}

long long current_timestamp() {
    struct timeval te;
    gettimeofday(&te, NULL); // get current time
    long long milliseconds =
        te.tv_sec * 1000LL + te.tv_usec / 1000; // calculate milliseconds
    // printf("milliseconds: %lld\n", milliseconds);
    return milliseconds;
}

int main(int argc, char *argv[]) {
    long long startAt = current_timestamp();
    double re = testFun(10, 16666611, 100000000);
    long long during = current_timestamp() - startAt;
    printf("%10s: result: %e, during: %lld ms\n", "C", re, during);
    return 0;
}

test.go:

/**
 * How to run:
 *  go run test.go
 */
package main

import (
    "fmt"
    "math"
    "time"
)

func main() {
    startAt := time.Now()
    result := testFun(10, 16666611, 100000000)
    during := time.Since(startAt)
    fmt.Printf("%10s: result: %e, during: %v\n", "Go", result, during)

    _ = math.Pow
}

func fun(x float64) float64 {
    return x*x - x
    // return math.Pow(x, 2) - x
    // return math.Pow(x, 2.4) - x
}

func testFun(first float64, second float64, times int) float64 {
    var i = 0
    var result float64 = 0
    var dx float64
    dx = (second - first) / float64(times)
    for ; i < times; i++ {
        result += fun(first + float64(i)*dx)
    }
    return result * dx
}

speed_v.v:

import time
import math

// compile & run with:  v -prod crun speed_v.v
fn main() {
    lang := 'V'
    start_at := time.now()
    result := run_fun(10, 16666611, 100000000)
    during := time.since(start_at)
    println('${lang}: result: ${result:.7}, during: ${during}')
}

fn fun(x f64) f64 {
    // return x * x - x
    return math.pow(x, 2) - x
    // return math.pow(x, 2.4) - x
}

fn run_fun(first f64, second f64, times int) f64 {
    mut i := 0
    mut result := 0.0
    dx := (second - first) / times
    for ; i < times; i++ {
        result += fun(first + i * dx)
    }
    return result * dx
}

Compile:

javac Test.java; gcc test.c -lm; go build test.go; v -prod speed_v.v

Run:

java Test; ./a.out ; ./test; ./speed_v

@Update - C program with -O2 or -O3 option

As suggested by Raffaello in the comment, when compiling C program, could use -O2 or -O3 to further optimize the program.

And, following are the test result for the C program:

  • When exponent = 2.4.
            C: result: 1.543194e+21, during: 5805 ms
 C with `-O2`: result: 1.543194e+21, during: 5324 ms
 C with `-O3`: result: 1.543194e+21, during: 5326 ms
  • When exponent = 2, still use pow() or Pow().
            C: result: 1.543194e+21, during: 897 ms
 C with `-O2`: result: 1.543194e+21, during: 119 ms
 C with `-O3`: result: 1.543194e+21, during: 121 ms
  • When exponent = 2, but use x * x instead.
            C: result: 1.543194e+21, during: 353 ms
 C with `-O2`: result: 1.543194e+21, during: 122 ms
 C with `-O3`: result: 1.543194e+21, during: 119 ms

Summary - (-O2 and -O3 option):

  • With -O2 and -O3 option
    • When base is integer (e.g 2), would make c program quicker, by several times.
    • When base is floating point number (e.g 2.4), it's also quicker, but very minimal.
  • Comparing between -O2 and -O3, they are quite close in above tests.
2 of 4
12

Don't translate from another language. Write the Go version of your program in Go. For example, x*x - x,

package main

import (
    "fmt"
    "math"
    "time"
)

func main() {
    start := time.Now()
    v := testFun(10, 16666611, 1000000000)
    since := time.Since(start)
    fmt.Printf("value is %v\ntime is %v\n", v, since)
}

func fun(x float64) float64 {
    return x*x - x
}

func testFun(first float64, second float64, times int) float64 {
    sum := float64(0)
    dx := (second - first) / float64(times)
    for i := 0; i < times; i++ {
        sum += fun(first + float64(i)*dx)
    }
    return sum * dx
}

Output:

$ go version
go version devel +5c11480631 Fri Aug 10 20:02:31 2018 +0000 linux/amd64
$ go run speed.go
value is 1.543194272428967e+21
time is 1.011965238s
$

What results do you get?

🌐
Career Karma
careerkarma.com › blog › tech guides › go vs java: differences and similarities compared
Go vs Java: Differences and Similarities Compared | Career Karma
July 20, 2022 - Java’s threads and synchronization primitives get the job done, just not as efficiently as Go’s do. It takes too much memory to make and destroy the threads in Java, and on a server each hit on the website needs its own thread. Most servers can only handle around 1,000 or maybe 10,000 Java threads.
🌐
Medium
medium.com › @mohitbajaj1995 › go-vs-java-performance-test-7face3f18a00
Go vs Java Performance Test - by Mohit Bajaj
November 3, 2024 - To conduct a detailed comparison of Go and Java performance, we can create a setup to test each language’s handling of high-concurrency requests, leveraging the Bombardier tool for load testing. Here’s a structured approach: ... package main import ( "fmt" "log" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, World!") } func main() { http.HandleFunc("/", handler) log.Println("Starting Go server on :8080") log.Fatal(http.ListenAndServe(":8080", nil)) }
🌐
Medium
medium.com › @kalpit.sharma › using-golang-instead-of-java-for-fast-processing-a-performance-comparison-69b63f411de8
Using Golang Instead of Java for Fast Processing: A Performance Comparison | by Kalpit Sharma | Medium
October 11, 2024 - - Web Servers: Golang servers tend to handle more requests per second than equivalent Java servers, especially when dealing with large numbers of concurrent connections. - CPU-Bound Tasks: Golang generally outperforms Java in CPU-bound tasks ...