One billion is not a very big number. Any reasonably modern machine should be able to do this in a few seconds at most, if it's able to do the work with native types. I verified this by writing an equivalent C program, reading the assembly to make sure that it actually was doing addition, and timing it (it completes in about 1.8 seconds on my machine).

Python, however, doesn't have a concept of natively typed variables (or meaningful type annotations at all), so it has to do hundreds of times as much work in this case. In short, the answer to your headline question is "yes". Go really can be that much faster than Python, even without any kind of compiler trickery like optimizing away a side-effect-free loop.

Answer from hobbs on Stack Overflow
🌐
DEV Community
dev.to › elinav › golang-vs-python-performance-which-programming-language-is-better-1lf3
Golang Vs. Python Performance: Which Programming Language Is Better? - DEV Community
January 20, 2025 - Performance is a major factor when comparing programming languages, particularly in applications that need the ability to scale, speed and effectiveness. Golang surpasses Python in regards to raw performance.
🌐
Oxylabs
oxylabs.io › blog › go-vs-python
Go vs Python: The Differences in 2026
Requires less code than Go. Contains automated garbage collection and typing. Open source. It is significantly faster than Python; performance is comparable to C++ and Java.
Discussions

Go Performs 10x Faster Than Python
Go should be at least 80x faster than python. More on reddit.com
🌐 r/golang
98
0
February 13, 2024
performance - Can Go really be that much faster than Python? - Stack Overflow
The first of which is that Go is compiled to machine code and run directly on the CPU while Python is compiled to bytecode run against a (particularly slow) VM. The second, and more significant, thing impacting performance is that the semantics of the two programs are actually significantly ... More on stackoverflow.com
🌐 stackoverflow.com
When you guys use Python or Go ?
Go when i need to maintain the code for a long time. Python for disposable code. More on reddit.com
🌐 r/golang
46
8
January 10, 2021
Go vs Python, employability for a grad / junior dev?
I strongly suggest you learn both. Every developer needs to gain skills in a minimum of two languages imo. Learning the differences helps you understand each more intimately. Python and Go are great choices for first two languages for a lot of reasons. Both in demand job wise. Both very easy to learn. And the languages are different in a lot of core ways that will help you really learn what the differences are. Python vs. Go OOP vs. procedural Scripting vs. compiled Dynamically typed vs. statically typed These are aspects of languages that hugely influence what you can and can’t do. They also make the language a good or bad tool for what you are doing. Having an appreciation for these things as well as skills in two of the most in demand languages right now would not be a bad way to prepare for a first job. More on reddit.com
🌐 r/golang
87
33
May 30, 2023
🌐
Medium
medium.com › @dmytro.misik › go-vs-python-web-service-performance-1e5c16dbde76
Go vs. Python: Web Service Performance | by Dmytro Misik | Medium
January 4, 2025 - For 1000 elements, Go maintained a throughput of 2,584 requests per second, while Python dropped to 341 requests per second. Remarkably, Go’s throughput for 1000 elements exceeded Python’s performance for 100 elements by nearly 2x.
🌐
Reddit
reddit.com › r/golang › go performs 10x faster than python
r/golang on Reddit: Go Performs 10x Faster Than Python
February 13, 2024 -

Doing some digging around the Debian Computer Language Benchmark Game I came across some interesting findings. After grabbing the data off the page and cleaning it up with awk and sed, I averaged out the CPU seconds ('secs') across all tests including physics and astronomy simulations (N-body), various matrix algorithms, binary trees, regex, and more. These may be fallible and you can see my process here

Here are the results of a few of my scripts which are the average CPU seconds of all tests. Go performs 10x faster than Python and is head to head with Java.

Python Average: 106.756
Go Average: 8.98625

Java Average: 9.0565
Go Average: 8.98625

Rust Average: 3.06823
Go Average: 8.98625

C# Average: 3.74485
Java Average: 9.0565

C# Average: 3.74485
Go Average: 8.98625
🌐
Zartis
zartis.com › home › software development › go vs python: performance, concurrency, and use cases
Go vs Python: Performance, Concurrency, and Use Cases | Zartis
October 28, 2025 - Coming to the performance results ... even though it’s easier and quicker to write data processing in Python, Go is quicker by an order of magnitude....
Top answer
1 of 8
97

One billion is not a very big number. Any reasonably modern machine should be able to do this in a few seconds at most, if it's able to do the work with native types. I verified this by writing an equivalent C program, reading the assembly to make sure that it actually was doing addition, and timing it (it completes in about 1.8 seconds on my machine).

Python, however, doesn't have a concept of natively typed variables (or meaningful type annotations at all), so it has to do hundreds of times as much work in this case. In short, the answer to your headline question is "yes". Go really can be that much faster than Python, even without any kind of compiler trickery like optimizing away a side-effect-free loop.

2 of 8
84

pypy actually does an impressive job of speeding up this loop

def main():
    x = 0
    while x < 1000000000:
        x+=1

if __name__ == "__main__":
    s=time.time()
    main()
    print time.time() - s

$ python count.py 
44.221405983
$ pypy count.py 
1.03511095047

~97% speedup!

Clarification for 3 people who didn't "get it". The Python language itself isn't slow. The CPython implementation is a relatively straight forward way of running the code. Pypy is another implementation of the language that does many tricky (especiallt the JIT) things that can make enormous differences. Directly answering the question in the title - Go isn't "that much" faster than Python, Go is that much faster than CPython.

Having said that, the code samples aren't really doing the same thing. Python needs to instantiate 1000000000 of its int objects. Go is just incrementing one memory location.

🌐
AugmentedMind.de
augmentedmind.de › 2023 › 01 › 22 › go-vs-python-senior-developers
Go vs. Python: an introduction to Go for senior (Python) developers
May 24, 2023 - Go has much better run-time performance than interpreted languages, such as Python. This is especially true for mathematical calculations, and demonstrated by benchmarks such as this one.
Find elsewhere
🌐
QIT Software
qit.software › home › blog › go vs. python in 2025: comparing performance & features  — qit
Go vs. Python in 2025: Comparing Performance & Features — QIT
January 10, 2025 - According to several tests, Go is up to 30 times quicker than Python. By resolving challenging tasks, you may compare how well the languages perform in this situation.
🌐
Orient Software
orientsoftware.com › blog › golang-vs-python-performance
Golang vs. Python Performance: Which Programming Language Is Better?
May 25, 2024 - For the vast majority of tasks, ... languages for their development speed (e.g., JavaScript, Python, and Ruby), it is much faster....
🌐
Django Stars
djangostars.com › home › golang vs. python: comparing performance and benchmarks
Golang vs. Python: Performance & Benchmarks Comparison | Django Stars
October 21, 2025 - And it worked! I got the same result as the performance benchmark test for both applications in Python and Go. First of all, I ran wrk to test the API endpoint to retrieve the long URL by short string. It was the right decision, because I received different results.
🌐
Software Engineering Daily
softwareengineeringdaily.com › home › why we switched from python to go
Why We Switched from Python to Go - Software Engineering Daily
March 3, 2021 - Thanks to Ren Sakamoto for translating ... The performance is similar to that of Java or C++. For our use case, Go is typically 40 times faster than Python....
🌐
AugmentedMind.de
augmentedmind.de › 2024 › 07 › 14 › go-vs-python-performance-benchmark
Go vs Python performance benchmark of a REST backend
July 14, 2024 - This article benchmarks the performance ... twice as fast as Python/FastAPI, which is surprising, given that Go is generally considered to be much faster than Python....
🌐
Bitfield Consulting
bitfieldconsulting.com › posts › go-vs-python
Go vs Python: choosing the right language for the job — Bitfield Consulting
October 5, 2020 - Go is a compiled language, which ... it on: an ARM chip, an X86_64, or whatever. This makes Go programs in general much faster than the equivalent programs in Python, which is an interpreted language, meaning that it’s not ...
🌐
Uvik
uvik.net › blog › go-vs-python
Golang vs Python in 2024: Deep Review and Comparison
January 10, 2026 - The popularity of the language within the target fields is explained by the Go’s major features: concurrency support, powerful and easy-to-use libraries, and, of course, its speed (Golang features a way faster performance compared to Python).
🌐
Medium
medium.com › deno-the-complete-reference › python-vs-go-how-faster-is-machine-code-compared-to-interpreted-code-for-jwt-sign-verify-de3b8d38c909
Python vs Go: How faster is machine code compared to interpreted code for JWT sign & verify? | Tech Tonic
November 18, 2023 - While Python operates as an interpreted language, it manages to offer a considerable challenge to Go. It is obvious that Go outpaces Python in terms of speed. Nevertheless, the performance differential is not as substantial when compared to ...
🌐
Extended Web
extwebtech.com › home › golang vs. python performance: which programming language is better?
Golang Vs. Python Performance: Which Programming Language Is Better?
March 1, 2024 - Blazing Fast Performance: The effort pays dividends for production infrastructure and performance-critical applications. While Python lags behind compiled languages like Golang in raw performance, it excels in developer productivity, quicker ...
🌐
Plain English
python.plainenglish.io › comparing-execution-speed-between-python-and-golang-e15197fdbca8
Comparing Execution Speed Between Python and Golang | by Shreyash Sikarwar | Python in Plain English
September 9, 2024 - The results confirmed my initial hypothesis — Golang is much faster when it comes to computational tasks. However, the decision to use one language over the other shouldn’t be based solely on speed.
🌐
Rubyroid Labs
rubyroidlabs.com › blog › web development › go vs. python: which programming language is better for a project?
Go vs. Python: Performance, Use Cases, and Key Differences — Rubyroid Labs
November 28, 2024 - Goroutines’ resource efficiency allows thousands of scenarios to run concurrently, leading to excellent scalability. Python CPython, the standard Python implementation, has a Global Interpreter Lock (GIL), which limits its capacity to scale and manage concurrent operations effectively. The GIL’s restriction on simultaneous bytecode processing across threads can cause performance bottlenecks, especially in CPU-intensive and multi-threaded contexts.