Commit 42bc00e2 authored by Vicente Mataix Ferrándiz's avatar Vicente Mataix Ferrándiz 🐍
Browse files

[STL] Comment about STL libraries performance

parent 20e927fb
......@@ -539,6 +539,8 @@
"\n",
"The reading of \\cite{Cukic2018} should provide more incentive to use them.\n",
"\n",
"It is important also to highlight that the STL algorithms may be more efficient that any development that may do, but these algorithms are designed in a very generic way, so these methods can be applied to any class in C++. Therefore. the reason for using the standard library algorithms is not to get better efficiency, it is to allow you to think at a higher level of abstraction. While there might be some cases where the algorithm will be faster than your own hand-rolled code, that's not what they're there for. One of the great advantages of C++ is that it allows you to bypass the built-in libraries when you have a specific need. If your benchmarking has shown that the standard library is causing a critical slowdown, you are free to explore classic alternatives such as loop unrolling. For most purposes that will never be necessary.\n",
"\n",
"On top of this, C++ 20 introduce a completely new way to deal with algorithms, which does not rely on direct use of iterators but instead on a range library. This leads to a syntax which is more akin to what is done in other languages - see for instance this example lifted from this [blog post](https://www.modernescpp.com/index.php/c-20-the-ranges-library):\n"
]
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment