Skip to content

MuggleWei/callback_benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

回调函数效率对比

直接使用函数指针与使用虚函数作为回调的效率对比

步骤

  • 生成工程: ./bootstrap.sh release
  • 生成随机数据, 模拟等待分发回调的消息号: 执行 example_gen_rand
  • 安装 gperftools 和 perf
  • 在 build 目录, 执行 pprof.sh 生成 CPU 采样
  • 在 build 目录, 执行 perfstat.sh 生成如: branch-misses, cache-misses 的一些数据

About

performance compare between func and vfunc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published