NetBeans CPU Profiler 使用挂钟时间还是 CPU 时间?
NetBeans CPU Profiler 使用挂钟时间还是 CPU 时间?例如,在考虑 I/O 将如何反映在分析结果中时,了解这一点很重要。
Does the NetBeans CPU Profiler use Wall Clock Time or CPU Time? This is important to know, for example, when thinking about how I/O will be reflected in your profiling results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NetBeans 默认使用挂钟(“绝对”)时间来进行所有方法计时计算。 CPU 时间方法是可用的,但目前仅适用于 Solaris。如果需要 CPU 时间,可以从“附加分析器”窗口中的“高级设置”区域启用它。 (该选项称为“使用线程 CPU 计时器(仅限 Solaris)”。)
无论选择哪个计时器设置,该设置都会全局应用于所有类/方法。 (相比之下,YourKit 允许您使用 CPU 时间对某些方法进行计时,而其他方法则使用挂钟时间。)
请注意,无论计时器模式如何,NetBeans 都会更正其计时信息以考虑分析器开销。
至于 I/O:使用默认(挂钟)设置,方法计时理论上将包括阻塞 I/O 操作所花费的时间。
有关计时器选项的更多详细信息,请访问 http://wiki.NetBeans.org/FaqProfilerUsingTimers。我发现与 http://wiki.netbeans.org/FaqProfilerSampledInstrumentation 一起查阅该页面很有帮助,它描述了仪器如何在“精确调用树和定时”模式和“精确调用树,采样定时”模式下工作。
The NetBeans default is to use wall clock ("absolute") time for all method timing calculations. A CPU time approach is available, but currently only on Solaris. If CPU time is desired, it can be enabled from the "Advanced settings" area in the "Attach Profiler" window. (The option is called "Use thread CPU timer (Solaris only).")
Regardless of which timer setting is chosen, that setting applies globally to all classes/methods. (For contrast, YourKit allows you to time certain methods using CPU time but other methods using wall clock time.)
Note that, regardless of timer mode, NetBeans does correct its timing info to take into account profiler overhead.
As for I/O: With the default (wall clock) setting, method timings will theoretically include time spent blocking on I/O operations.
More details about the timer options can be found at http://wiki.NetBeans.org/FaqProfilerUsingTimers. I found it helpful to consult that page together with http://wiki.netbeans.org/FaqProfilerSampledInstrumentation, which describes how instrumentation works in both "Exact Call Tree and Timing" mode and "Exact Call Tree, Sampled Timing" mode.