mirror of
https://github.com/cpp-best-practices/cppbestpractices.git
synced 2025-12-17 11:14:35 +03:00
Update 08-Considering_Performance.md
This commit is contained in:
@@ -39,6 +39,11 @@ Templates are not free to instantiate. Instantiating many templates, or template
|
||||
|
||||
For more examples see [this article](http://blog2.emptycrate.com/content/template-code-bloat-revisited-smaller-makeshared).
|
||||
|
||||
### Avoid Recursive Template Instantiations
|
||||
|
||||
Recursive template instantiations can result in a significant load on the compiler and more difficult to understand code.
|
||||
|
||||
[Consider using variadic expansions and folds when possible instead.](http://articles.emptycrate.com/2016/05/14/folds_in_cpp11_ish.html)
|
||||
|
||||
### Analyze the Build
|
||||
|
||||
@@ -46,6 +51,8 @@ The tool [Templight](https://github.com/mikael-s-persson/templight) can be used
|
||||
|
||||
After you build using Templight, you will need to analyze the results. The [templight-tools](https://github.com/mikael-s-persson/templight-tools) project provides various methods. (Author's Note: I suggest using the callgrind converter and visualizing the results with kcachegrind).
|
||||
|
||||
|
||||
|
||||
### Firewall Frequently Changing Header Files
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user