跳至主要内容

go开启profile


import (
    _ "net/http/pprof"
)

http.ListenAndServe("0.0.0.0:8080", nil)
 
 
然后 
http://127.0.0.1:8080/debug/pprof 查看整体信息 
 
下载profile文件 执行
go tool pprof profile cpu_profile
直接top看
或者安装graphviz 然后web
 

评论

此博客中的热门博文

源码编译LLVM

  cmake -S llvm -B build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt;libc;openmp" -DCMAKE_BUILD_TYPE=Release   cd build/   make -j8