How to have performance in systems? [closed]

0

How does the issue of performance in software, websites, etc. work?

Facebook transpiled PHP into C ++ to gain performance. How does it work? I know with C ++ to set exactly the variables, but does the performance depend on the language, programmer or hardware?

    
asked by anonymous 04.02.2018 / 00:19

1 answer

2

The greatest performance gain will always be given by the programmer. A wrong choice by easily changing performance by at least 10 orders of magnitude.

Using right algorithms is always the best way. Using performance libraries helps a lot. The language can make some difference, but only in very disparate languages will you have differences that can reach only an order of magnitude.

Cases of major differences are from poor libraries. Most chaos should not change more than 3 or 4 times.

An interpreted script language with dynamic typing and no mechanism that looks for the least cost of abstraction can really make a big difference. But the difference will not be so great just by transpilation . So much so that the payout got better when they switched to Hack . And more gain when they started using other languages.

Facebook did this because the initial decision was bad, there was a very large base of code to be ported, for some reason it was simpler to create a new infrastructure than to rewrite the whole code, which is a complete nonsense in a case like this. That is, they were in the mood to do this. And of course, the gain for them was very large. If you're using 10,000 servers and can reduce it to 1,000, it's worth the effort, I just think you could have rewritten the code in another language. Several unicorns have preferred this path, even if I try a general gain much lower than that of Facebook, but even greater in detail.

Every Stack Exchange network, including the main site with around 10 million visits per month, could, in the extreme limit, serve everything on a single server ( wheel in 9 to give slack ), and with performance well above that of Facebook. In C # it's not even a language considered so performative. This is engineering. There are people who do very simple things, without competition, just one operation, and clog the machine completely.

I even wondered if I needed all this. The expense to make software so fast is probably greater than the cost of adding a little more hardware, not to mention the inflexibility and difficulty of maintenance caused (UX is hampered because of the philosophy adopted, the improvements are implemented at the pace of turtle ). Facebook is also like this.

Hardware will give linear gain at most, probably well less than this. And the gain per dollar added will be much lower after entering the thousands.

I would respond a bit better if the question text were a little better.

    
04.02.2018 / 01:01