Scripts that compare looping speed between NodeJS, C, Python and Go
- Go looped 1,000,000,000 times in
0.292 seconds
(292 ms) - NodeJS looped 1,000,000,000 times in
0.587 seconds
(587 ms) - C looped 1,000,000,000 times in
2.394147 seconds
- Python3 looped 1,000,000,000 times in
22.139064056000002 seconds
- Golang version go1.13.1 darwin/amd64
- Node v10.16.3
- Clang version 11.0.0 (clang-1100.0.33.8)
- Python 3.7.3
# Run in Python
python speed-loop.py
# Run in C
gcc speed-loop.c -o speed-loop-c && ./speed-loop-c
# Run in Node
node speed-loop.js
# Run go
go run speed-loop.go