Combination of languages that have a better performance for Web

Asked

Viewed 566 times

-3

Many use PHP + HTML to create web pages, but it’s not the same with large websites like "social networks" (Facebook, Youtube, Instagram, Linkedin, etc...).

So I would like to know which are the combined languages that get the best performance for web development for both LARGE and SMALL projects, since "apparently" are not PHP + HTML based on them. The combination of ASP.Net + C# could also be a good combination?

I don’t know which tags to add, someone could help me by editing the question pfv?

  • In 99.9% of cases, speed of development and ease of maintenance are preferable to performance. Labor is usually more expensive than computational resources. That’s why they use PHP and HTML (mandatory for web systems), or any other scripting language. But if you want performance, you can do your code in C, which listens to the network and responds to the HTTP protocol, or even something similar in Assembly.

  • Facebook uses/used PHP. They used Hphpc, now supposedly they use HHVM which is the successor to Hphpc. It supports "Hack" and "PHP". This HHVM (http://hhvm.com/) was developed by Facebook itself, unless I was mistaken. Before PHP 7, the HHVM was extremely superior in speed. Today HHVM vs PHP 7 have minor differences, but HHVM is usually faster than PHP 7. Unless HHVM compiles code in C++, this helps immensely in performance. You can read more on https://goo.gl/0nnbYi.

  • It all depends a lot on what definition of performance you’re interested in. And if you ask "what is performance?" for ten different experienced programmers, you will get ten completely different answers. Also, as Guilherme Nascimento’s response demonstrates below, the choice of programming language is probably the least important factor in this.

  • Finally, you need to take into account which scenario really interests you as a performance factor. For example, it’s no use to use a super-optimized programming language to shred billions of numbers into matrices and make the craziest calculations you can imagine and that beats all the others in benchmarks about it, if your goal is to implement a social network site.

1 answer

7

Combination has nothing to do with it. In fact, programming languages have nothing to do with performance in a meaningful way, because what influences is how you use them, that is, how you program, regardless of how well it was designed.

Factors that influence performance loss:

  • Poorly written back-end code.
  • Not cache.
  • Connections in the database without need.
  • Frameworks that consume too much of the server for small applications.
  • Front-end code with a large number Resources or libraries and CSS that are usually used without need.
  • A server (machine + network) feeble:

    This is perhaps the most important item, usually a server Shared is shared with numerous customers who host their websites. In fact, most people use Shared or VPS (which is also shared but has fewer customers) to host their websites. These servers usually can’t handle much traffic.

  • The more users accessing, the better the machine will need to be.

These are some points. IE, it is no use to hire the best type of server and will not use everything, the question is plan and design, if the site will have a lot of traffic then you will have to hire a better server, from a VPS to a dedicated one.

In all cases the good is to always take advantage of the cache, this varies from language to language (back-end). An example I can quote you is that you cache static files such as images, icons, js, css:

There is no way ready or magic formula to achieve the desired result, what exists are some steps such as:

  • In front-end add only js, css and images that will actually use.
  • In the back-end include classes you will actually use.
  • Connect to a database or webservice only if needed.
  • Make a good use of the cache.
  • And the most important thing is to choose a server type according to the traffic you want to achieve.

About the benchmarks:

The benchmark is an operation performed in order to evaluate the performance of one software or compare it with another. You will find many comparatives on the back-end languages, but this is only one factor and usually in the end result it will not always be valid, I mean there really are some languages that have a slightly better performance, but it doesn’t mean that you use it will make your pages really quick.

I won’t post any benchmark results because most are based on ready frameworks or because usually different languages operate on different types of servers (operating system and http server), what is important to understand is that what has the greatest influence are:

  • Your choice of server to hire.
  • How you configure this server (if you have option to configure).
  • How you program and develop.
  • 1

    Can you give me a link, which contains the best form and in which operations the cache is used ? For a small product site.

  • @Magichat added ;)

  • Tks... Vlw ....................................

  • 1

    I think the servers and network is one of the main factors. I have only one server dedicated for a long time (it was 2x Deca-Core with 128GB RAM). But in it PHP and Mysql were together, a few months ago. Until I decided to divide them between one for PHP and another for Mysql. No other, now with each with 64GB (yes, it’s exaggeration! ) and one of them with 1x Hexa-Core (PHP) and the other 2x Hexa-Core (Mysql) work quietly and stable. Another thing is to remove Cpanel/Plesk and anything other than what you need (Nginx, php, fast-cgi....).

  • @Inkeliz a great complementary example, the server choice had already added, now added the list "How you configure this server (if you have option to configure)", thank you ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.