摘要:
该问题归结为std::transform函数的使用函数原型template OutputIterator transform ( InputIterator first1, InputIterator last1, OutputIterator result, UnaryOperator op );template OutputIterator transform ( InputIterator1 first1, InputIterator1 last1, InputIter... 阅读全文
随笔分类 - c语言
编写高效代码(大话处理器)
2013-07-16 15:25 by 江湖么名, 1127 阅读, 收藏,
摘要:
一、软件效率 软件性能剖析工具分析每个函数(有的工具能分析到每个循环)的执行时间。性能剖析软件:IBM(Rational Quantify)、Intel(VTune)、AMD(CodeAnalyst),DSP集成环境自带。 二、减少指令数 1. 使用更快的算法 快排,FFT算法 2. 选用合适的指令 3. 降低数据精度 4. 减少函数调用 a. 将小函数直接写成语句; b. 将小函数写成宏; c. 将函数声明为内联函数; 5. 空间交换时间 将中间结果保存(Google等搜索引擎算法) 6. 减少过保护 性能实在吃紧时,可以去掉冗余功能(函数参数检查... 阅读全文
浙公网安备 33010602011771号