英文:
Difference between net/http/pprof and runtime/pprof
问题
我已经阅读了关于这里的分析资料,其中使用了net_http_pprof和runtime_pprof进行解释。那么,这两者之间有什么区别,应该优先选择哪一个?请不要粘贴给定链接中的概述定义。
英文:
I have been reading about the profiling here it is explained using net_http_pprof and here runtime_pprof. So, what are difference between these two and which one should be prefer over another. And please don't paste the overview definition from the given links
答案1
得分: 7
net/http/pprof
通过Web界面公开了pprof分析器的数据。如果你正在编写一个基于服务器的系统,这可能很有用,因为你可能无法访问主机。
runtime/pprof
会将分析器数据写入一个数据文件,然后你可以将其转换为各种图像或文档类型。如果你正在编写一个不能或不会有Web界面的系统,那么这可能是你要使用的。无论哪种方式,它们都公开相同的数据。
英文:
net/http/pprof
exposes the pprof profiler data via a web interface. If you're writing a server-based system, this may be useful since you may not have access to the host.
runtime/pprof
will write the profiler data to a data file that you can then convert into various image or document types. If you're writing a system that can't or won't have a web interface, this is probably the one to use. Either way they expose the same data.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论