Measure execution speed of identical API endpoints developed in python, java, Golang, and Node.js.
There's much stigma around what the "best" backend language is. Python is notorious for being slow and unscalable. Most devs today refuse to touch anything that isn't node. Recently Golang is catching on. But how do they compare? Is one truly "faster" than the rest? How different are they?
Cratus aims to effectively answer these questions. While it is not possible to "benchmark" a language, per say, we can attempt to reduce incosistencies as much as possible and keep an eye out for major differences.
Clone repo, run build.sh
to set up dependencies. In the client/
directory, client.py
has functions for testing execution speed of services.
frontend/
has an interactive demo to visualize how fast X milliseconds appears to a userdatasets/
has previous results including raw data and graphs from previous runs. All new runs are saved here as well.client/
contains all files relating to measuring dataio/
contains some txt files for endpoints to parseservices/
contains all of actual endpoints, in their respective directories
- cd to
services/python
- Run
source env/bin/activate
to launch virtual env - To run directly from flask server, run
python endpoint.py
- To run from production gunicorn server, run
bash start_server.sh
- Run
deactivate
to exit virtual env
- cd to
services/node
- Run
npm start
to run directly from node application - Run
npm run prod
to run using pm2 (production process manager)
- cd to
services/go
- Run
go run endpoint.go
- Open the
spring/
directory in IntelliJ - Run
Endpoint.java
to run directly from application - Run
Server.java
to run using Tomcat production server