This repo holds the code for comparing the performance of counting to 10 million for C++, Go, Python, Java, NodeJS and PHP.
g++ main.cpp
time ./a.out
go build main.go
time ./main
javac Counter.java
time java Counter
time python main.py
time php main.php
time node main.js
- C++: 1.66s user 0.22s system 37% cpu 5.025 total
- go: 2.40s user 4.04s system 66% cpu 9.734 total
- python: 2.31s user 0.25s system 39% cpu 6.405 total
- PHP: 2.01s user 3.93s system 60% cpu 9.783 total
- Java: 5.73s user 3.93s system 81% cpu 11.873 total
- NodeJS: 1.79s user 0.46s system 24% cpu 9.182 total