Why frappe built in python when python slow?

I have general question as you read in the title, after few years of working as programmer and start to learn more than one language i start to read on large community and large industry of programming that python is one of the slowest language ever exist. so the question coming to my mind why then a lot of tools built on python if that the case?

Frappe, AI, Odoo, cyber security in general prefer python, data analytics and more built on python or prefer python

can i know why? Sorry for posting something not relevant to this community :grin:

2 Likes

Many of the things the framework does are not that compute intensive. E.g. for my business it doesn’t matter if validating an invoice takes 1 second or 0.1 seconds. What matters is that consultants can understand / extend / modify the logic.

Also, historical reasons. It was started with python almost two decades ago and it’s hard to switch later on.

Also, there are several other bottlenecks that are not solved by a fast language, but can be tackled independently: database, cache, disk, network.

6 Likes

That was also one my concerns about Frappeverse in 2018.

Being fast translates to nothing in business. If you want real evidence look for SQL Server Express users in SMEs. It just utilizes a few CPUs and few RAMs but SMEs still keeps upgrading their servers. So we compete within this scenario and their managers + bosses.

To conclude, ERP business don’t compete with C, C++. It must be mature and cover business cases. So test cases must cover as much detail as possible. But I assume that if Frappe were using C++ for the performance, Frappeverse don’t expand as fast as real universe.

2 Likes

Most of the time the bottleneck is human understanding and solving complexities.

That’s why rapid application development (RAD) languages are welcome with real human programmers, because they facilitate understanding code and experimenting with different solutions for problems encountered.
Python is such a RAD language, and, at least when it came out, it was, comparatively, a very clean one, easy to use and start with and also joyful to use. It still is, I’m not sure if there are easier to start and use RAD languages today. Tastes may differ of course, but there is a reason so many people use python.
It’s also a glue which allows to easily link many libraries together.

In many apps, the slowness is the user clicking and taking decisions in front of the desk, not so much crunching lots of data.
If really usefully crunching lots of data is needed, it’s always possible to include optimizations (e.g. indexing) or optimize critical parts of the code paths in other languages which are more difficult to use and get things right, but which are closer to machine stuff and their fast technologies. But generally, most of the time CPUs sit idly by, waiting for human clicks and typing or other input.

ERP systems depend a lot on laws and jurisdiction, which are changing faster than normal business processes, and often arbitrarily so, because they are results of human discord, bickering competitive human groups with different interests and views on justice and living together and what progress means.
So, software development efforts also need to keep pace with these.

2 Likes

@MAHMOOD_EBRAHIM
That is a fantastic question.

There are many different types of programming languages. For this conversation, it’s important to think about 2 of them: Compiled languages versus Interpreted / Scripting.

Python is an interpreted/scripting language. It is Easier to read & write, and is generally more Flexible, than compiled programming languages. This makes it very accessible to a wider audience. This is one reasons that data analysts choose Python.

Another consequence is that by being easier and friendlier, there are more humans that are proficient with Python. So if you’re the author of an open-source project and want a lot of global participation? There are many more Python developers on planet Earth, compared to C developers.

The consequence of these advantages, Easier + Flexible, is that Python programs are (usually) not as fast as programs that are written with Compiled programming languages (C/C++, Golang, Rust, Java, and many more). It’s also easier for developers to make mistakes in an Interpreted/Scripting language, that aren’t caught until the program executes.

Ultimately, there is no right or wrong answer. Every language has its advantages and disadvantages.

Also, like @rmeyer mentioned, sometimes achieving maximum speed and performance isn’t necessary or desireable. Sometimes you create a new program and decide “okay, that’s good enough for right now.”

1 Like

“Python is slow!” That’s true only if we’re talking purely about raw execution speed. Compared to compiled languages like C, C++, or Rust, Python is indeed slower. Even Java often outperforms it thanks to just-in-time compilation. But focusing only on runtime speed misses the broader picture of what makes a programming language valuable in real-world scenarios.

What truly matters in most software projects isn’t how fast the code runs, but how quickly it can be written, understood, and adapted. Python excels in this regard. Its concise and readable syntax allows developers to prototype and build solutions far more quickly than more verbose languages. In business environments where time-to-market is critical, Python often enables teams to deliver value faster and with fewer resources.

Python’s simplicity also makes systems easier to maintain and evolve. As business needs change, and you know what? They always do! Codebases written in Python are generally more approachable and flexible. This means less time spent debugging or rewriting code and more time focusing on delivering outcomes.

Another major factor in Python’s success is its vast ecosystem. Whether you’re building a machine learning model, a web application, an automation script, or an API, there are mature, well-supported libraries ready to use. The community behind Python is huge, helpful, and constantly pushing the language forward. For developers, that means access to support, tools, and shared knowledge that accelerate productivity.

Python is also highly portable and accessible. It runs well on almost any hardware, from cloud servers to low-cost devices like the Raspberry Pi. That makes it ideal for everything from enterprise software to hobby projects. You don’t need a specialized or high-end setup to get started or to keep things running smoothly.

In many enterprise settings, performance bottlenecks rarely come from the language itself. They’re more often due to complex integrations, overloaded data platforms, or slow legacy systems. Ironically, environments that demand “high-performance” sometimes accept inefficiencies elsewhere, like spending hours waiting for support from proprietary tools or managing bloated architectures.

While Python may not win performance benchmarks, it integrates seamlessly with high-performance modules written in C or C++, and modern frameworks like FastAPI and async libraries make it capable of handling demanding workloads. Python’s so-called slowness doesn’t prevent it from scaling, it just encourages thoughtful architecture and smart delegation of heavy lifting to optimized components.

Ultimately, business value isn’t measured in how fast a for loop executes. It’s measured in how effectively problems are solved. Python allows developers to deliver high-quality, reliable solutions with less overhead, more agility, and better maintainability. And that’s why so much important software today continues to be built with the slowest language in the room.

1 Like

It’s worth noting too that Frappe isn’t just python. It’s python, plus javascript, plus the http stack you’re using, plus your browser’s rendering engine, plus your internet connection, etc. When I’ve have to troubleshoot slow Frappe performance, it’s rarely been a matter of how fast python can process bytecode. Isolated performance benchmarks don’t translate directly user experience.

For cases where speed is really critical, python will happily interface to complied C libraries. This approach is very common in data analysis: you write the bulk of the code in a language that’s easy to write and maintain like R or Python, and if you find performance bottlenecks you rewrite the really critical parts in C.

1 Like