当前位置:网站首页>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
边栏推荐
- 对绘制丘岭密度图ridge plot的详细说明、重叠核密度估计曲线overlapping densities、FacetGrid对象、函数sns.kdeplot、函数FacetGrid.map
- 牙周炎问题调研(持续进行中)
- 【騰訊阿裏最全面試題集錦】(四面:3輪技術+1輪HR)
- How to use clion to debug a project built by the make tool
- 【RS-422与RS-485】RS-422与RS-485串行接口标准
- 2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一
- Br backup test
- Through the function seaborn cubehelix_ Palette build order palette
- Xiaomi's one-sided interview questions (self sorting answers)
- C # Advanced Programming - Feature Section
猜你喜欢
Detailed description of drawing ridge plot, overlapping densities of overlapping kernel density estimation curve, facetgrid object and function sns Kdeplot, function facetgrid map
Test development programmers, are you still confused? You can't define yourself as a yard farmer
基于ESP32CAM实现WebSocket服务器实时点灯
First day of learning MySQL Basics
Evolution in the digital age
Eureka server multi node deployment
2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一
MySQL系列之分库分表学习笔记
测试开发程序员,你还在迷茫吗?不能把自己定义为码农......
对绘制丘岭密度图ridge plot的详细说明、重叠核密度估计曲线overlapping densities、FacetGrid对象、函数sns.kdeplot、函数FacetGrid.map
随机推荐
Micro isolation (MSG)
Host computer development (Architecture Design of firmware download software)
Simple understanding of basic language of C language
牙周炎问题调研(持续进行中)
[Markov chain Monte Carlo] Markov chain Monte Carlo method sampling prior distribution
[Tencent Alibaba's most comprehensive collection of test questions] (four sides: three rounds of technology +1 round of HR)
TiDB Lightning
[turn to] FPGA interview questions
Ticdc introduction
What does my financial product mean in clearing?
C # using multithreading
Tidb implementation plan -- III
Uploading and retrieving stored images in localstorage
Vsys of Isis (virtual system)
The biggest highlight of wwdc2022: metalfx
面试必刷算法TOP101之单调栈 TOP31
Monotone stack top31 of interview must brush algorithm top101
Quick sort
【RS-422与RS-485】RS-422与RS-485串行接口标准
Through the function seaborn cubehelix_ Palette build order palette