Will using many libraries in C++ cause decline the speed or the memory ? | Sololearn: Learn to code for FREE!
+ 1

Will using many libraries in C++ cause decline the speed or the memory ?

21st Sep 2019, 3:38 PM
­ŁôÉ ­Łôó ­ŁôÉ ­Łôô ­ŁôĹ ­Łôö ­ŁôÜ
­ŁôÉ ­Łôó ­ŁôÉ ­Łôô ­ŁôĹ ­Łôö ­ŁôÜ - avatar
2 Antworten
+ 3
The more headers you include, the more code the compiler has to analyze, meaning the compile time will increase (although there are again differences when it comes to how you link to libraries). However, runtime speed and memory are only dependant on what happens inside your program, so they are unaffected by how many headers you include. Note that most modern compilers can also optimize out any unused code from headers you include, so that the executable file you get from compiling your program becomes smaller and more efficient.
21st Sep 2019, 4:02 PM
Shadow
Shadow - avatar
0
Thank you Shadow
22nd Sep 2019, 5:19 AM
­ŁôÉ ­Łôó ­ŁôÉ ­Łôô ­ŁôĹ ­Łôö ­ŁôÜ
­ŁôÉ ­Łôó ­ŁôÉ ­Łôô ­ŁôĹ ­Łôö ­ŁôÜ - avatar