<div>Hi, list</div>
<div> I write hackbench in erlang to test the performance, which is originally a benchmark for linux scheduler. </div>
<div> (Hackbench contains several groups; each groups contains 20 pairs of senders and receivers; each sender needs to send some messages to the 20 receivers in the same group. The performance is measured by the time taken, less is better.)</div>
<div></div>
<div> </div>
<div> The tests are carried out on an Intel server with 2 quad-core processors and 4G memory. </div>
<div> I am surprised with results I got:</div>
<div> (1) SMP enable +S 8</div>
<div> root@test:~/hackbench# \time ./run_one_erl.sh<br> Time is 62.260995<br> 295.67user 110.62system 1:14.27elapsed 546%CPU (0avgtext+0avgdata 0maxresident)k<br> 11776inputs+8outputs (27major+90965minor)pagefaults 0swaps</div>
<div> </div>
<div> The performance is 62 sec and the oprofile shows 28% cpu time is using in pthread_mutex_*.</div>
<div> </div>
<div> (2) SMP disable</div>
<div> <a href="mailto:root@test:~/hackbench">root@test:~/hackbench</a># \time ./run_one_erl.sh "-smp disable"<br> Time is 54.14644<br> 54.23user 0.33system 1:05.66elapsed 83%CPU (0avgtext+0avgdata 0maxresident)k<br>
3968inputs+8outputs (22major+36520minor)pagefaults 0swaps</div>
<div> </div>
<div> The performance is 54 sec and using only 83% cpu.</div>
<div> </div>
<div> So it seems the erlang has problems with using all the smp resources for serious lock contention in smp scheduler. Am I right?</div>
<div> And because I am new to erlang, the hackbench.erl may be in bad encoding, which will harm the performance. Can anyone help me review my code? </div>
<div> </div>
<div> I attach both the original C version of hackbench and my erlang version one.</div>
<div> </div>
<div> Thanks a lot!</div>
<div> (I am sorry If it is the wrong place to post this letter.) </div>
<div><br>-- <br>Best Regards,<br>Jiang, Wei<br></div>