Performance 如何看待Unix作业';执行后的性能(执行时间和cpu资源)?
我有一个传入任务,它告诉我在unix作业上进行性能测试。我想知道在UNIX中是否有什么东西可以告诉我作业的性能(执行时间和cpu资源)?我计划在前后进行比较。您可以使用linux配置文件工具Performance 如何看待Unix作业';执行后的性能(执行时间和cpu资源)?,performance,unix,testing,jobs,Performance,Unix,Testing,Jobs,我有一个传入任务,它告诉我在unix作业上进行性能测试。我想知道在UNIX中是否有什么东西可以告诉我作业的性能(执行时间和cpu资源)?我计划在前后进行比较。您可以使用linux配置文件工具perf,例如: perf stat ls 在我的电脑中: Performance counter stats for 'ls': 2.066571 task-clock # 0.804 CPUs utilized
perf
,例如:
perf stat ls
在我的电脑中:
Performance counter stats for 'ls':
2.066571 task-clock # 0.804 CPUs utilized
1 context-switches # 0.000 M/sec
0 CPU-migrations # 0.000 M/sec
267 page-faults # 0.129 M/sec
2,434,744 cycles # 1.178 GHz [57.78%]
1,384,929 stalled-cycles-frontend # 56.88% frontend cycles idle [52.01%]
1,035,939 stalled-cycles-backend # 42.55% backend cycles idle [98.96%]
1,894,339 instructions # 0.78 insns per cycle
# 0.73 stalled cycles per insn
370,865 branches # 179.459 M/sec
14,280 branch-misses # 3.85% of all branches
0.002569026 seconds time elapsed
您可以尝试使用
time
命令进行粗略的一次近似。