This project is a performance comparison experiment between Go and Node.js running on Google Cloud Run.
It consists of two functionally identical applications (one in Go, one in Node.js) that interact with Google Cloud Firestore. Both applications are instrumented with OpenTelemetry to provide deep insights into latency and execution tracing via Google Cloud Trace.
go-app/: A Go web server usinggorilla/muxandhtml/template.node-app/: A Node.js web server usingExpressandEJS.infra/: Terraform configuration to provision the Google Cloud environment (Cloud Run, Firestore, Artifact Registry, etc.).
The goal is to deploy both applications to Cloud Run and measure:
- Cold Start Latency: How fast does the container spin up and serve the first request?
- Runtime Performance: How fast is the request processing (API handling + Template rendering)?
- Resource Usage: Memory and CPU footprint difference.
To run these applications, you need a Google Cloud Project. You can set this up manually or use the provided Terraform infrastructure.
See the Infrastructure README for instructions on how to provision the entire environment using Terraform.
- Enable APIs:
cloudtrace.googleapis.com,logging.googleapis.com,monitoring.googleapis.com. - IAM Roles: Ensure your deployer has
Cloud Run Admin,Artifact Registry Admin(for source deploy), andService Account User. - Firestore: Create a
Nativemode database.
- Clone the repository.
- Navigate to the desired application folder (
cd go-apporcd node-app). - Follow the specific README in that folder to build and deploy.
Once both services are deployed to Cloud Run, you can use a load testing tool like hey or wrk to generate traffic.
Example Benchmark:
# Test Node.js App
hey -n 1000 -c 50 https://node-app-url.run.app/
# Test Go App
hey -n 1000 -c 50 https://go-app-url.run.app/
Then, visit the Google Cloud Console > Trace to visualize the latency distributions and see the "waterfall" of spans for specific requests.