论坛首页 综合技术论坛

erlang r12 新增加Percept并发性能调测模块

浏览 2778 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-11-19  

Percept is an application-level profiler with focus on parallelism.

Can help in finding:
    – synchronization bottlenecks
    – periods of few runnable processes

Makes use of new trace points in the virtual machine.

Collects data about when processes are runnable andwaiting.

Graphical interactive presentation of collected data.

  • 描述: percept preview
  • 大小: 64.9 KB
   发表时间:2007-11-19  
来做个尝试,程序是 widefinder项目的 tbray9a.erl,经过少量修改,去掉了 halt():

引用
1> percept:profile("test.dat", {tbray9a,start,[]}, [procs]).
Starting profiling.
8900    : 2006/09/29/Dynamic-IDE
2000    : 2006/07/28/Open-Data
1300    : 2003/07/25/NotGaming
800     : 2003/09/18/NXML
800     : 2003/10/16/Debbie
800     : 2006/01/31/Data-Protection
700     : 2003/06/23/SamsPie
600     : 2006/01/08/No-New-XML-Languages
600     : 2006/09/07/JRuby-guys
600     : 2005/07/27/Atomic-RSS
ok
2> percept:analyze("test.dat").
Parsing: "test.dat"
check_activity_consistency, invalid start state: inactive.
insert_trace, bad_state: {profile,<0.30.0>,inactive,
                                  {code_server,call,2},
                                  {1195,446574,24650}}
Parsed 79 entries in 1.79400e-3 s.
    5 created processes.
    0 opened ports.
ok
3> percept:start_webserver().
{started,"test98",57194}


在浏览器打开 http://localhost:57194/ 截图如下:



  • 大小: 22.7 KB
  • 大小: 14.5 KB
  • 大小: 20 KB
0 请登录后投票
   发表时间:2007-11-20  
不错,非常直观,这样不用我在Code中手工加代码测试各process的耗时了。图示结果表明,并行的第2到第5个Processes确实是差不多同时启动,且并行运行。第一个Process是在合并结果,这个非并行的耗时并不是最主要的。而且,erl的启动时间看来也在整个耗时中占了一部分,不过对更大的文件来说这部分时间就不重要了。
0 请登录后投票
   发表时间:2007-11-21  
另外还添加了Common Test Test Server2个Application来测试erlang的整个系统 用户可以直接写test case 貌似不错。
0 请登录后投票
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics