Eche Mkpadi

Publish my digital interests

A Billion Loop Iterations in Java, Js, Go and Python

I saw this thread on twitter where a guy tested the speed of 1 billion loop iterations in these four languages: JavaScript, Python, Go and C. See thread here

Granted, the more fun thing would’ve been something similar to the 1brc but this is just benchmarking language performance for a naive problem.

The author did not include Java so I did and ran the benchmark on my machine.

Results

benchmark-chart

benchmark-table

Machine Spec and Software Versions

hardware-spec

Software versions:

I don’t know if it is a cPython thing, but Python was incredibly slow. I eventually concluded it’s something wrong with my computer just so I don’t piss off the cPython community 😁