MĂ”jude analĂŒĂŒs, mida avalikustab final vĂ”tmesĂ”na C++ programmide tulemuslikkusele

Benjamin Summerton, PSRayTracing ray tracing system author, analyzed the performance impact of using the C++ keyword "final", introduced in the C++11 standard. The testing was prompted by claims circulating online that using "final" could enhance performance, which were based on subjective assessments without specific results to back up the changes.

Benjamin's testing revealed that the performance impact of using "final" highly depends on the compiler. When compiling with GCC, performance indeed improved in a noticeable number of cases, but with Clang and MSVC, performance mostly decreased, and more significantly. Additionally, the platform had a large influence; for example, performance degradation was more pronounced on an AMD Ryzen 9 6900HX system than on an Apple M1 CPU system.

MĂ”jude analĂŒĂŒs, mida avalikustab final vĂ”tmesĂ”na C++ programmide tulemuslikkusele
MĂ”jude analĂŒĂŒs, mida avalikustab final vĂ”tmesĂ”na C++ programmide tulemuslikkusele

For instance, on an AMD Ryzen 9 6900HX system with Ubuntu 23.10, compiling with Clang showed a slowdown in 90% of tests when using "final", at least 5%, but in 2.5% of cases, there was at least a 5% increase in speed. For GCC, a 5% slowdown was recorded in 0.9% of cases, while a 5% increase occurred in 15.8% of cases. In MSVC, a 5% slowdown appeared in 26.2% of tests, and a 5% speed increase in 13.3%. The author of the study concluded that it is advisable to avoid using "final".

Allikas: opennet.ru

Osta usaldusvÀÀrne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid đŸ”„ Osta usaldusvÀÀrne hostimine veebilehtede jaoks DDoS-i kaitsega, VPS VDS serverid | ProHoster