<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Well 10 years back I built a VM that precomputed all the random numbers since it's a *small* amount, you'll note the code does store the last&nbsp;<div>seed so storing the index wasn't hard so it was lookup in static array, increment index.&nbsp;</div><div><br></div><div>There was a few percent performance gain if you did Object new 100 million times. But I'm afraid nothing you could see in real life. This was on hardware</div><div>were executing instructions cost computable microseconds. &nbsp;</div><div><br></div><div>The other adventure was tuning the New logic, not a complete rewrite but refining the IF tree logic, that resulted in a few percent, but again in real life nothing that would justify screwing with the code. Still that was long ago, maybe things have changed. I still have the changes sets of course.</div><div><br></div><div>Let me attach the email from&nbsp;<span class="Apple-style-span" style="font-size: 12px; ">July 19, 2003 12:52:37 PM PDT &nbsp;</span><span class="Apple-style-span" style="font-size: 12px; "><b>[VM] HashBits, a lazy way &nbsp;</b></span></div><div><br></div><div><div><div>On 2011-01-06, at 9:33 AM, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Thu, Jan 6, 2011 at 6:23 AM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
&nbsp;<br>Hi folks. I am trying to understand a little how hash is assigned and how it works in the SqueakVM. I have a couple of questions:<br><br></blockquote></div><br>
</blockquote></div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">--</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt; &nbsp; Twitter: &nbsp;squeaker68882</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Corporate Smalltalk Consulting Ltd.&nbsp;&nbsp;<a href="http://www.smalltalkconsulting.com">http://www.smalltalkconsulting.com</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div><br></div></div></div></div></div></div></span></div><br class="Apple-interchange-newline">Things are a bit quiet this morning so I wandered over to my freebsd intel box and downloaded<br>the unix 3.5-development tar file and build an intel squeak vm.<br><br>I used a interp.c &nbsp;I had (from june 30th) &nbsp;which was a bit newer, but followed the same pattern as the one that Ian is shipping, gnuified, use of global structure foo, use of AHC changeset to localize variables in the interpreter<br><br>For the 3.6.1bx interp.c that used<br>BitOfGCTuning-JMM<br>which removes the +1 in the headerTypeBytes lookup, plus some localization for the mark/sweep<br>InterpreterFixes-3Point6 from Andreas<br>CodeGenEnh-3Point6 from Andreas<br>MakePrimPointXInternal-JMM which makes point x/y internal in the interp.c<br>allocateNoFillHashTable-JMM which has improved allocation/nofill &amp; hashtable lookup.<br><br>Not quite the same, however in running tinybenchmarks I noted<br><br>june 30thVM 40,738,383 bytecode/sec 972,076 sends/sec<br>3.6.1bxVM &nbsp;&nbsp;&nbsp;&nbsp;40,429,564 bytecodes/sec 984,169 sends/sec<br><br>Similar performance, but the 3.6.1bxVM has better sends/second. Due to the CodeGenEnh I think...<br>Certainly one is not extraordinary faster than the other.<br><br>However &nbsp;when I looked at allocation rates for 1 asFloat, &nbsp;2@3, Array new: 5 I saw<br><br>june30thVM 37,654, 40,198, 31,037<br><br>3.6.1bxVM &nbsp;&nbsp;&nbsp;75,952, &nbsp;82,524, 39,325<br><br>Ah, much nicer, also quite remarkable as compared to the powerpc benchmarks.<br><br>These changes did translate into a savings in the macrobenchmarks.<br>371,654 versus 376,568<br>It's hard to say if the better performance is due to allocation, or to faster sends/second.<br>however cutting small object allocation time by 50%should show up somewhere.<br><br>Someone will need to do a better degree of testing, to better reflect just the hashtable/ old hash differences? Versus &nbsp;my wholesale before/after testing. And of course try this under windows.<br><br>PS The intel box is a dual pentium 350Mhz, which ran 49.5% busy during the testing.<br>gcc version 2.95.4 was used, gcc 3.3.x might do a better job?
</div>
<br></div></body></html>