Python Vs Golang: Performance test

Sagore Sarker
2 min readFeb 3, 2022

--

Python Vs Golang: Image collected from google

Do you code in python or Golang? Or another language? But have a question about python vs Golang performances? Then, this article for you. I’ll show you a proven way to visualize the efficiency of these two languages.

For the most part, Python is an interpreted language and not a compiled one. On the other hand, Golang is a compiled language. If you don’t have any idea about what are compiled language and interpreted language, you can follow this article.

Python is first introduced in 1991. By its age, it has a huge developer community who try to make it more efficient day to day. And Golang is first conceptualized in 2009. Both of these languages are open-source. Python is mainly developed by Guido van Rossum, a Dutch programmer. And the Golang is developed by Google. Golang is new to our computer world. But the growing community of Goalng language, it increases it popularity day by day. Personally, I’m working on both of these languages. That’s why, I have a little experience of both of it.

I tried to solve Remove Duplicates from Sorted Array problem from LeetCode. Here I’ll share the performance test both of these languages. I tried same approaches for solving the same problem.

Remove Duplicate from Sorted Array LeetCode: Golang vs Python Performance

For python, it took 93 ms runtime and space of 15.6 MB where in Golang it took only 7 ms runtime and 4.4 MB memory.

So, in conclusion, we can say that Goalng is a lot faster than Python in runtime. And in memory, Golang also win. Theoretical research on these two languages shows that Go is typically 40 times faster than Python. For deploying applications on server sites, Go is widely used in recent time.

--

--

Sagore Sarker
Sagore Sarker

Written by Sagore Sarker

I’m doing by Bachelor Degree in Computer Science and Engineering from a public university in Bangladesh. And interested in writing coding related article.