30 ms·
It's not a lie at all. That's why there is profile guided optimizations for C/C++. Which instruments you C/C++ code to collect that needed additional informat
by dathinab 3y ago
It's not a lie at all.
That's why there is profile guided optimizations for C/C++.
Which instruments you C/C++ code to collect that needed additional information (on the cost of performance).
Then when recompiling you can feed that collected information into your system.
The problem with profile guided optimization is that it's way more annoying to deploy as on every update you have to deploy it twice once slower then naive and then once faster. And because the slower part might very well be to slow you might want to only deploy it to some nodes of a load balancer and deploy naive compiled versions to the other.
It also means you have a similar slower => faster startup time, excepts it's of your program as whole instead of for each restart of a node.
And while optimized Java likely will never outperform optimized C++ that is Java specific furthermore if we speak about common non manual optimized code which isn't implementing some tight math/CS algorithms (i.e. very common daily code in many companies) then the difference really isn't that big, small enough to make choosing java over C++ for server stuff a "in general" the right choice. (If you are not a company which only gets the "best" programmers like google).
I mean just to put it into context there are companies which had success with stuff like running high speed trading code on the JVM and it was a success. So if you can do that probably Java doesn't have a major performance problem.
> not over relying on RAII
you mean like throwing out all the major improvements of C++ which majorly reduced the probability of non highly expert programmers introducing bugs which could be turned into RCEs?
- wredue 3y agoSuggesting that you shouldn’t be allocating memory and then immediately tossing it doesn’t only suggest that you should practice RCE prone manual strategies. RAII is dogshit because it encourages and hides the fact of what’s really happening, leading to crazy performance gotchas. Just knowing the gotchas around it is often enough for any half way competent programmer to devise better code.
- dathinab 3y agoRAII is the foundation of safe memory management in C++