Ousterhout's article1 about scripting languages suggests that the higher level the programming takes place, the more productive the programmer is. If we take that, as Boehm says2, the number of lines a programmer can write in a given time is constant and not dependent on the language or its type (low level, system programming, scripting), one can easily believe the claim. The resulting instructions-per-source-code-line -ratio can be an order of magnitude (or several) better with scripting languages than with system programming languages.

As scripting languages heavily rely on ready-made utilities for common tasks (e.g. data structures, string manipulation), their main use usually is to enhance productivity with the cost of slower running speed by providing a syntax that's easy to learn and efficient to upkeep programs with. One doesn't resort to a scripting language when top execution speed is needed.

[1]: J. K. Ousterhout, Scripting: Higher Level Programming for the 21 Century, Computer (IEEE), 1998
[2]: B. Boehm, Software Engineering Economics, Prentice Hall, 1981

Answer from Jawa on Stack Exchange
🌐
Reddit
reddit.com › r/godot › differences in speed between c, c++, python and java
r/godot on Reddit: Differences in speed between C, C++, Python and Java
December 13, 2023 -

I saw a video on YouTube about how much slower python could be compared to C++ in some instances, so I tried to test it myself, a simple program that counts from 0 to 1000,000,000 and displays the 1000,000,000 afterwards. The exception in my case was that I also tested this for C and Java, and found that as expected, C was faster than C++(not by much though) and python(by leaps and bounds), but to my surprise, Java was the fastest, even faster than C, how could this be?

Execution Times:

C - 2.815s C++ - 2.837s Python - 2m 1.451s Java - 0.861s

🌐
Quora
quora.com › Which-programming-language-is-faster-Python-C-or-Java
Which programming language is faster, Python, C++, or Java? - Quora
Answer (1 of 3): In general, C++ is the fastest (compiled, low-level control), Java is in the middle (JVM adds overhead but is still optimized), and Python is the slowest (interpreted, high-level, great for quick development).
Discussions

Is programming in Python faster than in C, C++ or Java? - Software Engineering Stack Exchange
To put it generally, writing a program in Python will usually be faster than writing the same program in C, C++, Java. It is also likely to run slower. There are, of course, particular applications for which other languages may be quicker because certain tasked involved are 'more natively' supported. While I am not aware of any studies to confirm this increase in speed... More on softwareengineering.stackexchange.com
🌐 softwareengineering.stackexchange.com
Is Python slower than Java/C#? - Stack Overflow
As mentioned in the other answers this depends on the run-time system as well as the task at hand. So the standard (C)Python is not necessarily slower than Java or C#. Some of its modules are implemented in C. Thus combining speed of a native implementation with Python's language. More on stackoverflow.com
🌐 stackoverflow.com
Python vs. Java performance (runtime speed) - Stack Overflow
Possible Duplicate: is python slower than java/C#? Ignoring all the characteristics of each languages and focusing SOLELY on speed, which language is better performance-wise? You'd think this ... More on stackoverflow.com
🌐 stackoverflow.com
Java vs python vs C++
All of those languages are useful in different situations. Python's very popular with scientists, ML engineers, and the like. Non-programmers who need to write programs love it because it's approachable and has a plugin for basically anything. It's my favorite language for writing tiny, one-off programs and doing hackathons and coding competitions and stuff. Java's the workhorse of the corporate world. If you're writing a giant application full of business logic for a big corporation, and you're gonna maintain it for two decades, Java's still the default choice. C++ is the most powerful option. If you need something to go as fast as it can go, C++ is your default choice. But whole types of bugs around stuff like memory that are basically impossible to cause in Python or Java are really easy to cause in C++, and its error messages aren't so much legible as they arSegmentation Fault (core dumped). You can go far with any of them, and there's a good chance you'll end up learning all three at some point. More on reddit.com
🌐 r/learnprogramming
104
215
May 23, 2023
🌐
Medium
medium.com › swlh › a-performance-comparison-between-c-java-and-python-df3890545f6d
A Performance Comparison Between C, Java, and Python | by Gunavaran Brihadiswaran | The Startup | Medium
July 24, 2020 - A Performance Comparison Between C, Java, and Python This is what happened when I ran matrix multiplication in all three languages I have been doing a lot of implementations in C language for my …
Top answer
1 of 5
19

Ousterhout's article1 about scripting languages suggests that the higher level the programming takes place, the more productive the programmer is. If we take that, as Boehm says2, the number of lines a programmer can write in a given time is constant and not dependent on the language or its type (low level, system programming, scripting), one can easily believe the claim. The resulting instructions-per-source-code-line -ratio can be an order of magnitude (or several) better with scripting languages than with system programming languages.

As scripting languages heavily rely on ready-made utilities for common tasks (e.g. data structures, string manipulation), their main use usually is to enhance productivity with the cost of slower running speed by providing a syntax that's easy to learn and efficient to upkeep programs with. One doesn't resort to a scripting language when top execution speed is needed.

[1]: J. K. Ousterhout, Scripting: Higher Level Programming for the 21 Century, Computer (IEEE), 1998
[2]: B. Boehm, Software Engineering Economics, Prentice Hall, 1981

2 of 5
8

If you measure productivity as "time to write a specific simple program" then it depends so much more on programmer experience and quick mind than the language that you are really evaluating the programmer, not the language.

I believe timed code contests indicate that the language doesn't really matter for those kinds of tasks. There is no one language that wins such challenges easier than others (at least not if you allow for the relative popularity of languages).

If you measure performance as "the effectiveness of the best program" written in a given language, then it's even less language-dependent. See for example the results of the Galcon AI contest. The winner is written in Lisp. The next Lisp entry, however, is ranked #280. What does this tell us about the language's suitability for writing great AI efficiently? In my opinion, nothing. It just tells us that "bocsimacko" came up with and implemented the most effective algorithms. For the record, time was not a major factor in this contest - people had more than two months to develop their code.

Lastly, if you measure performance as "long-term cost of maintaining a project" then I think you're onto something. Especially if you hire only the best people for the job, and count cost in man-hours rather than dollars. I have a strong opinion on which languages are best for this, but having no hard evidence to link you to I'll leave this opinion out. Perhaps someone else has links for this type of performance.

Top answer
1 of 13
125

Don't conflate Language and Run-Time.

Python (the language) has many run-time implementations.

  • CPython is usually interpreted, and will be slower than native-code C#. It might be slower than Java, depending on the Java JIT compiler.

  • JYthon is interpreted in the JVM and has the same performance profile as Java.

  • IronPython relies on the same .NET libraries and IL as C#, so the performance difference will be relatively small.

  • Python can be translated to native code via PyREX, PyToC, and others. In this case, it will generally perform as well as C++. You can -- to an extent -- further optimize C++ and perhaps squeeze out a little bit better performance than unoptimized output from PyREX.

    For more information, see http://arcriley.blogspot.com/2009/03/so-long-pyrex.html

Note that Python (the language) is not slow. Some Python run-times (CPython, for example) will be slower than native-code C++.

2 of 13
62

It is not really correct to ask why Python is slower than Java/C#. How fast is Java? Well, naive interpreters are around ten times slower than optimised compilers. I believe there is a Java bytcode interpreter written in JavaScript - that probably isn't very fast. So, the intended question appears to be "Why is the CPython language system slower than the equivalent Sun, IBM and Oracle JRE and Microsoft .NET runtime?"

I believe the correct answer is non-technical. The fastest Java and .NET runtime are faster because they have large full time technical teams developing them in performance-competitive environment.

Dynamic language systems are easy to implement. Any idiot can do it. I have. Static language systems are more complex to design and implement. A simple static system will tend to run much faster than the equivalent just-working dynamic equivalent. However, it is possible for highly optimised dynamic systems to run almost as fast. I understand some Smalltalk implementation were quite good. An often quoted example of a developed dynamic system is the MIT Lisp Machine.

In addition if the real grunt is being done by library code, then the language system may not matter. Alternatively, the language may encourage (or give time(!)) to develop more efficient algorithms which can easily wipe out constant factor performance differences.

Find elsewhere
🌐
Sololearn
sololearn.com › en › Discuss › 253502 › c-vs-java-vs-python-who-wins-
C++ vs Java vs Python who wins? 💪💪 | Sololearn: Learn to code for FREE!
Speed of Execution 🏃 🏃 🏃 Python’s execution speed is slower compared to Java and C++. Being dynamic and interpreted language, Python execution is slower. In comparison between Java and C++, execution speed of C++ is faster than Java.
🌐
ClarionTech
clariontech.com › blog › java-vs.-python-vs.-c
Java vs C vs Python for App Development: A Guide for CTO
December 6, 2024 - While it is frequently derided as being less performant when it comes to CPU-heavy workloads than Java or C#, it is a fantastic language for prototyping and scalable python app development in and cloud-native applications with rapid turnaround times.
Address   The Hive, Raja Bahadur Mill Rd, Beside Sheraton Grand Hotel, Sangamvadi, Pune, 411001
🌐
GeeksforGeeks
geeksforgeeks.org › java › c-vs-java-vs-python
C vs C++ vs Java vs Python vs JavaScript - GeeksforGeeks
Java – Compiled to bytecode, runs on JVM (interpreted/JIT-compiled). Platform-independent, strongly typed, with automatic garbage collection. Popular for enterprise android and backend systems. Python – Dynamically typed, typically first compiled and then interpreted via bytecode execution.
Published   August 12, 2025
🌐
Quora
quora.com › C-vs-Java-vs-Python-who-will-win-64
C++ vs Java vs Python: who will win? - Quora
In comparison between Java and C++, execution speed of C++ is faster than Java. ... In this case Java uses more memory compared to Python and C++. Python has decent memory consumption, C++ is more memory efficient.
🌐
Quora
code.quora.com › Which-language-is-best-C-C-Java-or-Python
Which language is best, C++, C#, Java, or Python? - Code - Quora
Python for when you need to do something quickly, and C# for when you need better performance. They are both very easy. C# is slightly more difficult, but it is worth it. As a beginner, I guess it would be better to stay away from C , C++ and Java.
🌐
Medium
timilehin-ty.medium.com › so-java-kinda-runs-like-python-why-is-it-10x-faster-2b12148918cb
So, Java Kinda Runs Like Python. Why Is It 10x faster?! | by Timilehin Tayo | Medium
May 25, 2024 - Concurrency: Java supports robust multi-threading; Python’s GIL (Global Interpreter Lock) limits concurrent execution in CPython. The reason really is that Java was designed and implemented with speed as a priority while Python was designed and implemented with simplicity and intuitiveness as major priorities over speed.
🌐
Reddit
reddit.com › r/learnprogramming › java vs python vs c++
r/learnprogramming on Reddit: Java vs python vs C++
May 23, 2023 -

Hey y'all, I'll be needing to choose either one of Java, python, c++ or web programming for my second semester in electronics and communications but i have no idea where to start from

I've learnt all the basics of c programming in my first semester and i have to choose between the above mentioned for the second semester and it's really rattling my brain

Which of them would be better for a beginner to programming language and which would be most helpful in the future, if you'd have to say?

Thanks in advance!

Top answer
1 of 5
264
All of those languages are useful in different situations. Python's very popular with scientists, ML engineers, and the like. Non-programmers who need to write programs love it because it's approachable and has a plugin for basically anything. It's my favorite language for writing tiny, one-off programs and doing hackathons and coding competitions and stuff. Java's the workhorse of the corporate world. If you're writing a giant application full of business logic for a big corporation, and you're gonna maintain it for two decades, Java's still the default choice. C++ is the most powerful option. If you need something to go as fast as it can go, C++ is your default choice. But whole types of bugs around stuff like memory that are basically impossible to cause in Python or Java are really easy to cause in C++, and its error messages aren't so much legible as they arSegmentation Fault (core dumped). You can go far with any of them, and there's a good chance you'll end up learning all three at some point.
2 of 5
88
Love Python, but I’m in the “it’s better as your 2nd/3rd language” camp. The others are ‘harder’ and force you to gain a deeper understanding. Then you can pickup Python super easy. “Oh hey, it basically works the same but just does all the fiddly bits for me”. But you would know what those fiddly bits are, and can check the docs and be certain that behind the curtain it really is doing what you think it is. People who do it the other way around seem to have it harder, they don’t know how much Python is doing for them, why, or that it even is.
🌐
Medium
medium.com › cognitivecraftsman › unraveling-the-speed-disparity-why-python-lags-behind-java-and-c-3328f8313598
Unraveling the Speed Disparity: Why Python Lags Behind Java and C++ | by Muralikrishnan Rajendran | CognitiveCraftsman | Medium
March 22, 2024 - These languages (C++ and Java) benefit from Just-In-Time (JIT) compilation and other optimization techniques at runtime. Python’s interpreter doesn’t have the same level of optimization. While there are alternative implementations like PyPy that use JIT compilation to improve execution speed, the standard CPython interpreter executes bytecode in a more straightforward, and hence, slower manner.
🌐
Reddit
reddit.com › r/askprogramming › is java faster than python?
r/AskProgramming on Reddit: Is java faster than python?
January 31, 2024 -

Java is said to be much faster than python but there are different ways to run these languages (e.g. pypy for python, maybe dalvik for java). Is there any way python could be made faster than java?

Top answer
1 of 5
17
All things being equal, yes Java is usually faster than Python. That said, there are some pretty important qualifiers to that statement: Much of the "heavy lifting" done by Python is actually implemented in super-optimised C and C++ code which is (again, all other things being equal) faster than Java code, e.g. the Numpy library is a good example of this. Many programmes - e.g. most web apps - are I/O Bound (meaning that their performance is limited by the speed of input/output operations such as sending messages over the network or retrieving information from a database), meaning that, in practice, the speed difference between Java and Python is irrelevant, as the programme spends 99% of its execution time on I/O. Speed of implementation is often more important than speed of language. An inefficient Java implementation will often be orders of magnitude slower than an efficient Python on. Developer time is often relevant. Python advocates often state (rightly or wrongly) that as Python is more concise and "simpler" than Java, meaning that it allows Python developers to be more productive than developers using other languages, which is relevant if CPU cycles are cheaper than engineer wages.
2 of 5
5
Last time I checked, yes, by a huge margin. Java's execution is like reading shorthand (Compiler+JIT), python is like reading Shakespeare (Slow-ass interpreter). While there's good efforts made to make unofficial compilers that can convert Python or Java to Assembly, it's not easy since both languages rely on the VMs that run them to do things like automatic memory management, so the code you have inside your Python/Java program isn't the full story. You also need a garbage collector written in Assembly among other things. This makes it very difficult to turn into native code. That's the efficiency kind of performance. But there's also performance gains from leveraging more hardware that you also need to worry about. Even if you used these unorthodox assembly compilers, the language itself can hamper this performance, like the ability to multithread, which the Python spec lacked for a very long time.
🌐
Lasting Dynamics
lastingdynamics.com › home › build a software › python vs java, c++ & more: ultimate showdown in 2025-2026
Python VS Java, C++ & More: Ultimate Showdown in 2025-2026
1 month ago - However, development speed tells a different story: Python enables 2-10 times faster development for many tasks compared to C or Java, making it ideal for projects where time-to-market is critical.
🌐
Coursera
coursera.org › coursera articles › computer science and engineering › web and app development › python vs. java: which should i learn?
Python vs. Java: Which Should I Learn? | Coursera
September 12, 2025 - If you're ready to get started with one of these impactful programming languages, consider enrolling in either the University of Michigan's Python for Everybody Specialization or IBM's Java Developer Professional Certificate program. When it comes to sheer speed, Java is a clear winner.