<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 11 sep 2012, at 16:22, Kostis Sagonas <<a href="mailto:kostis@cs.ntua.gr">kostis@cs.ntua.gr</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On 09/11/2012 09:06 AM, Tony Rogvall wrote:<br><blockquote type="cite"><br>On 10 sep 2012, at 19:03, Thomas Lindgren <<a href="mailto:thomasl_erlang@yahoo.com">thomasl_erlang@yahoo.com</a><br><<a href="mailto:thomasl_erlang@yahoo.com">mailto:thomasl_erlang@yahoo.com</a>>> wrote:<br><br><blockquote type="cite"><blockquote type="cite">________________________________<br>From: Kostis Sagonas <<a href="mailto:kostis@cs.ntua.gr">kostis@cs.ntua.gr</a> <<a href="mailto:kostis@cs.ntua.gr">mailto:kostis@cs.ntua.gr</a>>><br><br><br>I do not know why Thomas thinks that HiPE should be able to<br>confortably beat BEAM on this sort of code (care to elaborate?). From<br>a brief glance it seems to me that the code spends a lot of time in<br>BIFs written in C (most notably list_to_tuple/1 and element/2, but<br>also trunc/1, abs/1 and math:sin/1. All of these are outside the<br>reach of the native code compiler.<br></blockquote><br><br>The regular MD5 algorithm is basically a loop doing lots of integer<br>arithmetic and bit operations as well as accessing a few arrays. This<br>ought on the face of it to be quite amenable to native code<br>compilation. I'm amazed that the implementation Tony used managed to<br>get trunc/abs/sin into the inner loop, but that might as you say well<br>explain the problem.<br></blockquote><br>My goal with this implementation was not speed. I really wanted<br>something simple to look at. erlang:md5 already exists, and<br>there is no point competing with that. I just compiled it native for<br>fun. So do not be amazed! :-)<br>But as shown by kostis and others it looks like it is my computer that<br>behaves badly, I will have a look.<br></blockquote><br>I investigated this further.  Can it be that your computer runs in 32-bit mode?  If so, I can explain what is happening.<br><br></blockquote>Yes.</div><div><br></div><div>/Tony</div><div><br><blockquote type="cite">Kostis<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">"Installing applications can lead to corruption over time. </span><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>