当前位置:网站首页>Performance tuning can't just depend on tapping the brain
Performance tuning can't just depend on tapping the brain
2022-06-13 07:08:00 【guangsu.】
qcachegrind
background
Quantifiable is the precondition of problem solving . Performance optimization cannot be limited to theoretical analysis , Quantitative indicators should be obtained with the help of performance analysis tools . So as to measure the optimization scheme more accurately .
Every mature language has its own performance monitoring tools . for example :
- golang : pprof
- php : xdebug , xhprof
These performance monitoring tools are time-consuming for the program by means of hook embedding , Memory usage , Call sequence and other key data to record . To generate a response monitoring report .
When these files are generated, they are recorded according to the unified reporting protocol , This makes it easy to use sophisticated analysis tools ( Or self-developed tools ) To parse the analysis report . At the same time, it is also convenient for
Develop common performance analysis tools to parse analysis reports generated in different languages .
The more popular single machine performance monitoring tools on the market are :
- qcachegrind -> platform:Win / MacOS
- kcachegrind -> platform:Linux
- webgrind -> platform: Linux / Win / MacOS This is great
kcachegrind And qcachegrind It's essentially the same thing , It's just that they use different graphics engines .kcachegrind be based on KDE. and qcachegrind be based on Qt.
xdebug Generate performance analysis file ,qcachegrind Format the file , Provide good readability .
brew install graphviz
brew install qcachegrind
MacOS: qcachegrind install
brew install graphviz
Execute this command to install graphviz, be used for Call Graph functionbrew install qcachegrind
install qcachegrind. ( If call graph The function cannot be used . pleasesudo ln -s /usr/local/bin/dot /usr/bin/dot
)
function qcachegrind
#> nohup qcachegrind &
dashboard Interpretation of indicators
invocation count
total inclusive cost
=>incl
shows the time consumed by the function including calleestotal self count
shows the time consumed by the function not including callees cost
Word interpretation
- caller caller
- callees Callees
- invocation call
- invoke call , quoted
xdebug Configure the instance
[xdebug]
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable=on
xdebug.idekey='PHPSTORM'
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
; Performance analysis section
xdebug.profiler_enable=Off
; Enable the performance analysis trigger mode Instead of triggering performance analysis for every request And xdebug.profiler_enable=0 When used in conjunction with :w
xdebug.profiler_enable_trigger=On
; url Contained in the XDEBUG_PROFILE Performance analysis will be triggered only when the parameters are aligned eg. http://local.web.vhall.com/index.php?XDEBUG_PROFILE=aaa
xdebug.profiler_enable_trigger_value='aaa'
xdebug.profiler_output_dir="/Users/sujianhui/PhpstormProjects/profiler_output"
xdebug.profiler_output_name=callgrind.out.%u
Reference material
qcachegrind Installation guide https://blog.csdn.net/weixin_33881753/article/details/88923382
QCacheGrind Introduction to the use of tools https://blog.csdn.net/raoxiaoya/article/details/111994696
xdebug Quick reference table https://blog.csdn.net/qq624202120/article/details/64124087
phpstorm in xdebug Configuration of https://www.cnblogs.com/yjken/p/8435018.html
Interpretation of instrument cluster parameters https://stackoverflow.com/questions/33094913/how-do-i-read-the-ui-of-qcachegrind
边栏推荐
- Why is the blind box e-commerce mode so popular?
- Eureka server multi node deployment
- Chain 2+1 reward, what kind of mode is beautiful everyday seconds?
- 【騰訊阿裏最全面試題集錦】(四面:3輪技術+1輪HR)
- Tikv key performance parameters and optimization
- New Taishan crowdfunding business diversion fission growth model in 2022
- Ml: introduction to stability analysis of machine learning model and detailed introduction to common solutions
- Soup side (8)
- FSM状态机
- 10 Honest Facts I Want To Share With All Junior Developers
猜你喜欢
How to make a development board from scratch? Illustrated and illustrated, step by step operation for you to see.
在 localStorage 中上传和检索存储图像
简单了解C语言基本语
SDN basic overview
测试开发程序员,你还在迷茫吗?不能把自己定义为码农......
2022-06-12:在N*N的正方形棋盘中,有N*N个棋子,那么每个格子正好可以拥有一个棋子。 但是现在有些棋子聚集到一个格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二维数组代表,一
WWDC2022最大的亮点: MetalFX
Raspberry school advanced development - "writing of IO port driver code" includes bus address, physical \u virtual address and bcm2835 chip manual knowledge
RT-Thread 模拟器 simulator LVGL控件:slider 控件
FSM state machine
随机推荐
What does my financial product mean in clearing?
[Markov chain Monte Carlo] Markov chain Monte Carlo method sampling prior distribution
杭州网上开户是安全的吗?
Evolution in the digital age
Fundamentals of assembly language: register and addressing mode
First day of learning MySQL Basics
Database connection under WinForm
学习Mysql基础第一天
Why is the blind box e-commerce mode so popular?
WWDC2022最大的亮点: MetalFX
How to use clion to debug a project built by the make tool
简单了解C语言基本语
线程池中的 工作线程如何被回收
Uploading and retrieving stored images in localstorage
2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一
Lightning data import
Reflection of C # Foundation
【腾讯阿里最全面试题集锦】(四面:3轮技术+1轮HR)
通过函数seaborn.cubehelix_palette生成顺序调色板
Postgraduate entrance examination English