Navigate back to the homepage

Why python is slower then other low level programming languages?

October 15th, 2020 · 2 min read

Hello Friends,

Welcome To Infinitbility!

Python is an interpreted language so it is slower than a compiled language by default.

Consider this idea. There are three people.

One speaks English. One speaks Spanish One speaks English and Spanish

The Englishman writes a book but to read that book the Spanish person has to ask the translator to read the book to him line by line. It takes time but by the end the Spanish person has read the book. But everytime he wants to read the book he must ask the translator to read each line again. This is the concept of an interpreted language.

In the second scenario, the Englishman writes a book. The translator takes the book and rewrites the whole book in Spanish and gives it to the Spanish person. The Spaniard has the book forever. If he wants to read it again he just looks at his translated book. It’s much faster than the other method but if anything changes in the book it has to be re-translated again in its entirety. This is the concept of a compiled language

The third concept is a semi-compiled language, in this idea the translator takes the English book and writes notes about it. The notes allow him to quickly create a book in real time for any person of any language. Once he has written the notes he can give them to a person that reads any language and they can use the notes to create a book in their language using Thier local language translator. This is the concept behind languages like Java.

Each method has its strengths and weaknesses. Interpreting is cheap on memory and quick to make changes. Compiling is a one time effort that takes time but once done you are speaking the processors own language so it’s fast to get the message across and you’re not storing the original book so it’s compact. It’s downside is having to recompile the whole thing if you want to update the program.

The Java style program differs this issue by being somewhere in the middle. It can be compiled into standalone code, but it can also be compiled into a halfway house code (called Bincode) which can be compiled “just in time” to do the job. The compiler is installed on the recipients machine (JIT) and the compiled code is done on the spot. This means that you can write just one program which can be used on more than one browser on a processor (browser based), or processor itself (standalone). The concept is to let you just write the code once, but allow it to be compiled by many. The design of the JIT for each machine allows the program to make the code look and function the same.

With regard to Compilers, Compilers are not unique to certain languages. A compiler ‘can’ be written for any language. For instance there are compilers for Visual BASIC, but a language which is designed from the ground up specifically to be compiled is more likely to be efficient and compact rather than one which is forced to compile. For compilers, efficiency is the most important factor. To that end the way that a programming language is structured can have a significant effect on the the efficiency of the compiler. For instance C++ is targeted at the reuse of Classes , Methods and Functions and it’s is highly structured in a hierarchical format, Object Orientated Programming (OOP), not only helps with Rapid Application Development (RAD) but reduces the code size and therefore ease and efficiency in the compiling stage and the Linking stage (where the code is tailored to function within an operating system).

Thanks for reading…

Follow me on Twitter

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide



More articles from Infinitbility

How to Check if value exists in array JavaScript, php

How to Check if value exists in array using indexOf for javascript and in_array for php

October 11th, 2020 · 1 min read

How to exit from initramfs busybox in Ubuntu

here you get solution of busybox initramfs issue in ubuntu

October 11th, 2020 · 1 min read
© 2020–2022 Infinitbility
Link to $ to $ to $ to $ to $ to $mailto:[email protected]