Deno vs Go : Hello World Performance

Mayank C
Tech Tonic

--

Recently, there has been requests to run a measured performance comparison between Deno 2 and Go. Similar comparisons done in the past have gone outdated. This article compares Deno 2 vs Go for a simple hello world case.

The framework choices are:

  • On Deno side, we’re using Hono framework
  • On Go side, we’re using Gin framework

The application code is as follows:

Deno

import { Hono } from "npm:hono";

const app = new Hono();

app.get("/", (c) => c.text("Hello World!"));

Deno.serve({ port: 3000 }, app.fetch);

Go

package main

import (
"net/http"
"github.com/gin-gonic/gin"
)

func main() {
r := gin.New()

r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello world!")
})

r.Run(":3000")
}

All tests are executed on MacBook Pro M2 with 16G of memory.

As always, I’ve used Bombardier load testing tool for running the tests.

I’m executing a single test with 100 concurrent connections to reach 5M requests. A warm-up of 10K requests is provided before starting the measurements.

It is time to get into the results. The results in bar chart form are as follows:

If you prefer a tabular summary, here it is:

The results were quite surprising. For a simple hello world case, sure enough, Go is faster than Deno. Machine code has to be faster than interpreted code. However, the difference is hardly noticeable. Deno offers 134K RPS, while Go offers 138K. In terms of resource usage, Go uses very little memory, but a very high CPU.

Thanks for reading!

--

--

Tech Tonic
Tech Tonic

Published in Tech Tonic

Articles on popular things like Node.js, Deno, Bun, etc.

Mayank C
Mayank C

Responses (1)