1ms Faster
Home
  • Program

    • Lean in C++
  • Perfromance Engineering

    • [>>>>>]
  • Reading Note

    • [>>>>>]
  • ComputeArch

    • [_]
  • Compiler

    • [_]
  • System

    • [_]
Authoring
  • Categories
  • Tags
GitHub (opens new window)

Quincy Jet

We are.
Home
  • Program

    • Lean in C++
  • Perfromance Engineering

    • [>>>>>]
  • Reading Note

    • [>>>>>]
  • ComputeArch

    • [_]
  • Compiler

    • [_]
  • System

    • [_]
Authoring
  • Categories
  • Tags
GitHub (opens new window)
  • Lean in c++

  • Performance Engineering

  • Misc

  • Reading Notes

    • Effective C++

      • 习惯C++
      • 构造,析构, 和重载赋值运算符
      • 资源管理
      • 设计与声明
      • 实现Implementations
      • 继承与OOP
      • 模板,Templates and GP
      • 定制new和delete
      • 杂项, Misc
    • More Effective C++

    • 《C++ 性能优化指南》
      • Optimized C++: proven techniques for heightened performance
      • CH1 基础策略
      • Ch2 影响计算机性能的行为
      • Ch3 性能测量
      • Ch4 字符串优化
      • Ch5 算法优化
      • ch6 动态分配内存的变量优化
      • ch7 热点语句的优化
      • ch8 使用更好的库
      • ch9 优化查找和排序
      • ch10 优化数据结构
      • ch11 优化IO
      • ch12 优化并发
      • ch13 优化内存管理
  • Wiki
  • Reading Notes
Quincy Jet
2022-06-27
Content

《C++ 性能优化指南》

# Optimized C++: proven techniques for heightened performance

《C++ 性能优化指南》

# CH1 基础策略

  1. 更好的编译器
  2. 更好的算法
  3. 更好的库
  4. 减少内存分配和赋值
  5. 减少计算密集部分
  6. 更好的数据结构
  7. 并发和并行处理;
  8. 优化内存管理(更好的内存管理库)

# Ch2 影响计算机性能的行为

  1. 内存访问的代价是非常大的
  2. cache miss
  3. pipeline stall导致cycle被浪费
  4. 线程切换, 同步的锁的开销,是非常大的;
  5. 系统调用是昂贵的
  6. 非对其的字节访问, 开销会很大, 会带来page threading 的效果;
  7. 计算比分支判断的速度要快;
  8. 所有的语句并非都是顺序执行.\
  9. 也不是所有指令的开销都是一样的, 每个指令所需要的cycle数量应该是不同的;

# Ch3 性能测量

  1. 时间测量(timer)是非常必要的
  2. CPU硬件profile测量也是有必要的
  3. 使用profiler工具 找出热点代码
  4. 90-10, 80-20方法
  5. 性能优化其实是一种实验
  6. 算法更优不代表其执行速度就会更快, 因为要考虑到实现时候的效率
  7. 要有baseline, 要有实验记录, 要有随手记实验数据的习惯;
  8. 测量延时, 测量吞吐, 测量batch
  9. linux上面, 如何进行profile, 原理是什么, 如何进行时间测量, 怎么样测量才会比较精确
  10. 设置一些matrices, 根据这些指标来指导性能优化;
  11. profile很重要

# Ch4 字符串优化

# Ch5 算法优化

# ch6 动态分配内存的变量优化

# ch7 热点语句的优化

# ch8 使用更好的库

# ch9 优化查找和排序

# ch10 优化数据结构

# ch11 优化IO

# ch12 优化并发

# ch13 优化内存管理

Last updated: 2023/06/18, 16:23:56
杂项讨论,Misc

← 杂项讨论,Misc

Copyright © 2017-2023 Quincy Jet | MIT License
  • Auto
  • Light
  • Dark
  • Read