Does Performance and Speed of language really matter for Back-End?

Does Performance and Speed of language really matter for Back-End?

Programming Jul 29, 2023

There are a bunch of programming languages out there with any kind of Performance and speed. And a lot of conversations have been to answer the question of all time: Does Performance and Speed really matter for Back-End?! Let's have some POV on this question and maybe we find an answer to it.


First of all, Let's talk about Memory, We have two kinds of Programming Language in the context of Memory Management:

  • The type that controls memory usage with the help of GC(Garbage Collector) and lets developers have limited control over memory. These are slower in action.
  • The type that lets the developer control the memory usage by allocating and freeing them whenever they want. These are way faster and more efficient.

For gaining Performance and Speed, Of course, we need cleaner memory.

The Way of Execution

Second, We need to take a look at how the Programming Language runs the code:

  • Compiled Languages, Which our code compiles to Machine Code. The fastest type of Programming Languages.
  • Interpreted Languages, Which our code runs on an Interpreter and executes the code line by line. The Slowest type of Programming Languages.
  • Compiled/Interpreted Languages, which our code compiles to a binary Byte Code and then we have a VM that runs the code. These Languages are fast but not as the first category and not as slow as the second category.

I didn't mention the name of the languages because we all know these things and we can name a lot of languages we don't code in them but it's cool to know about them.

What was these for?

The two section above Is the ones normally people care about. There are some performance freaks who count bit by bit to deliver the best performance they can and write a lot of tweets and articles about It. But let me ask a question: Do they really matter? It depends, But NO.

If you look at benchmarks(they are not a valid thing to reference because They depend on a lot of things like CPU, RAM, Disk Type, Network, Arch, etc) you see insane numbers of hundreds of thousands of requests per second. And you be like wow 😱.

First, You have to consider what type of API you want to write and how many users will request It in a second. You see, A lot of developers want more RPS to flex about It 😂. But when it comes to Business and Time you have, You don't want to decide based on the Performance and Speed you can have. YOU DON'T HAVE THAT MUCH USER.

PHP Is not one of them, But THE ONE language has been dying for decades and still, a lot of Back-Ends use It to serve users. Let me tell you PHP has no running process until a Web Server like Nginx or Apache runs the index.php file. In every request, The source code loads from line 1 to the last line of code with all dependencies to serve the result. Just for one F*in request!

This language with the help of Laravel which is a framework for writing Web Apps and APIs, Can serve Thousands of requests per SECOND. How many users will request per second to your API? And we also can save a lot of loads with caching systems like MemCached, Redis, etc.

Of course, I don't say that nothing matters and just use Laravel, Django, or anything else, and don't care about anything. In most cases, Just use something to start and don't worry about it, If you don't write some API to FAANG or you know you are gonna have a massive amount of users in a short time.

Finally, Let me tell you that I don't like PHP at all, But I love the reality. Thanks for reading. Mention your comment below and let's talk about it.


Benyamin Eskandari

Curious, Experienced Android Developer Also in love with Rust, DevOps, and System Programming Trying to read a lot of books and learn a lot of things, I will write posts about my path on this journey.