List of common C++ Optimization Techniques(常用 C++ 优化技术列表)
问题描述
我可以列出一个很好的常用 C++ 优化实践列表吗?
Can I have a great list of common C++ optimization practices?
我所说的优化是指您必须修改源代码才能更快地运行程序,而不是更改编译器设置.
What I mean by optimization is that you have to modify the source code to be able to run a program faster, not changing the compiler settings.
推荐答案
编写更好程序的两种方法:
Two ways to write better programs:
充分利用语言
- Steve McConnell 完成的代码
- 有效的 C++
- 出色的 C++
配置您的应用程序
- 确定哪些代码区域占用了多少时间
- 看看是否可以使用更好的数据结构/算法来加快速度
没有多少特定于语言的优化可以做 - 它仅限于使用语言结构(从 #1 中学习).主要好处来自上面的#2.
There is not much language specific optimization one can do - it is limited to using language constructs (learn from #1). The main benefit comes from #2 above.
这篇关于常用 C++ 优化技术列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:常用 C++ 优化技术列表


- 如何对自定义类的向量使用std::find()? 2022-11-07
- C++ 协变模板 2021-01-01
- 从python回调到c++的选项 2022-11-16
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 近似搜索的工作原理 2021-01-01
- STL 中有 dereference_iterator 吗? 2022-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01