<br><br><div class="gmail_quote">On Wed, Feb 27, 2013 at 6:12 PM, Juan Vuletich <span dir="ltr">&lt;<a href="mailto:juanlists@jvuletich.org" target="_blank">juanlists@jvuletich.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi Eliot,<br>
<div class="im"><br>
&gt;  On Wed, Feb 27, 2013 at 10:03 AM, Eliot Miranda<br>
&gt; &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; Hi Juan,<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Feb 27, 2013 at 8:45 AM, Juan Vuletich (mail lists) &lt;<br>
&gt;&gt; <a href="mailto:juanlists@jvuletich.org">juanlists@jvuletich.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Quoting &quot;David T. Lewis&quot; &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Wed, Feb 27, 2013 at 08:19:20AM -0300, Juan Vuletich (mail lists)<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hi Folks,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; In Cuis 4.1 (<br>
</div>&gt;&gt;&gt;&gt;&gt; <a href="https://github.com/jvuletich/**Cuis/blob/master/**" target="_blank">https://github.com/jvuletich/**Cuis/blob/master/**</a><br>
&gt;&gt;&gt;&gt;&gt; Cuis4WithLatestUpdates/Cuis4.**1-1619.zip?raw=true&lt;<a href="https://github.com/jvuletich/Cuis/blob/master/Cuis4WithLatestUpdates/Cuis4.1-1619.zip?raw=true" target="_blank">https://github.com/jvuletich/Cuis/blob/master/Cuis4WithLatestUpdates/Cuis4.1-1619.zip?raw=true</a>&gt;)<br>

<div class="im">&gt;&gt;&gt;&gt;&gt; I included AndreasSystemProfiler. But sometimes it is good to use a<br>
&gt;&gt;&gt;&gt;&gt; StackVM for profiling, to avoid Cog inlining and get results that are<br>
&gt;&gt;&gt;&gt;&gt; easier to<br>
&gt;&gt;&gt;&gt;&gt; follow.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; The Mac and Windows VMs referenced from squeakVM.org don&#39;t include<br>
&gt;&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt;&gt; required primitives. The only VMs with those primitives I found are<br>
&gt;&gt;&gt;&gt;&gt; CogVMs from Eliot&#39;s site.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I just added a mantis issue for this:<br>
&gt;&gt;&gt;&gt;<br>
</div>&gt;&gt;&gt;&gt; <a href="http://bugs.squeak.org/view.**php?id=7746" target="_blank">http://bugs.squeak.org/view.**php?id=7746</a>&lt;<a href="http://bugs.squeak.org/view.php?id=7746" target="_blank">http://bugs.squeak.org/view.php?id=7746</a>&gt;<br>

<div class="im">&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Eliot, can you give me a quick pointer to the primitives in Cog that<br>
&gt;&gt;&gt;&gt; need<br>
&gt;&gt;&gt;&gt; to be added to the interpreter VM? Thanks.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  Does anybody know if there are plans to add those primitives to<br>
&gt;&gt;&gt;&gt;&gt; StackVMs?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; A terminology note, this issue is for the interpreter VM. The stack VM<br>
&gt;&gt;&gt;&gt; is<br>
&gt;&gt;&gt;&gt; part of Cog, and I expect that a stack VM will already contain the<br>
&gt;&gt;&gt;&gt; necessary<br>
&gt;&gt;&gt;&gt; primitives (though I did not check).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks for the correction. I understand that the interpreter VMs will<br>
&gt;&gt;&gt; have the primitives in the future. Thank you!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Let me restate, then. Does anybody know if there are recent StackVMs<br>
</div>&gt;&gt;&gt; precompiled for major platforms? I could not find any at Eliot愀 site.<br>
<div class="im">&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I could be encouraged to build and add these to my site.  But I wonder<br>
&gt;&gt; why<br>
&gt;&gt; you need them.  What&#39;s wrong with the Cog VMs?<br>
&gt;&gt;<br>
&gt;<br>
&gt; First of all, Cog doesn&#39;t do inlining; it only does good inline cacheing,<br>
&gt; including memoing whether a send is an MNU.  Second, one can disable the<br>
&gt; JIT using -cogmaxlits -1 on the command line.  You&#39;ll get something slower<br>
&gt; than the StackVM (because it&#39;ll be asking the jit whether methods should<br>
&gt; be<br>
&gt; jit all the time) but you should get values close to the StackVM.<br>
<br>
</div>Thanks for the correction wrt inlining. There&#39;s nothing wrong with Cog.<br>
Cog is wonderful. Also thanks for the -cogmaxlits -1 tip. I&#39;m sure I&#39;ll<br>
find use for it.<br>
<br>
Let me explain my problem.<br>
<br>
Tim&#39;s recent feedback on performance in Raspberry PI made me want to go do<br>
some profiling on a slow machine. The slowest machine I have at hand is a<br>
Thinkpad T23, Pentium III, 1.1GHz. I use a program called &quot;Cpukiller3&quot;,<br>
that can slow it down to (for example) Raspi performance levels. Besides,<br>
I integrated AndreasSystemProfiler in Cuis, and I prefer using it. Now I<br>
need a suitable Windows VM:<br>
- CogVM: Can&#39;t run on the P-III, as it doesn&#39;t include SSE2 instructions.<br>
- StackVM: Not currently built by you. I don&#39;t know if it would require<br>
SSE2, anyway.<br></blockquote><div><br></div><div><br></div><div><div><br></div><div>I certainly intended that neither of these would need SSE2, but that they would use SSE2 if available.  SSE2 instructions are used in the Stack and Cog VMs for locking/atomic instructions used in things like signalling external semaphores.  The code in platforms/Cross/vm/sqAtomicOps.h is supposed to fall back on non-SSE2 instructions if SSE2 is not defined (but I&#39;ve not tested it recently).  So try building on Windows with SSE2 not defined and you may get lucky.</div>
<div><br></div><div>In Cog, SSE2 is further used to implement fast floating-point primitives.  If the processor doesn&#39;t have SSE2 the Cog doesn&#39;t generate the primitives.  So the thing to try is building the current sources but deleting -msse2 from the line in cygwinbuild/Makefile:</div>
<div><br></div><div>CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mthreads -mno-cygwin -mwin32 \</div><div>    -mno-rtd -mms-bitfields -mno-accumulate-outgoing-args $(OFLAGS) $(NOBUILTIN)</div><div><br></div><div>If you try this let me know either way.  I can add the description to HowToBuild.</div>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- InterpreterVM a.k.a. ClosureVM. Currently doesn&#39;t include the new<br>
profiling primitives. Will include them, eventually. Right now, this is<br>
what I&#39;m using, limited to less precise MessageTally. It is also what I&#39;ve<br>
been using for several years to look for code to optimize in Cuis.<br>
<br>
Additionally, wrt Cog, on 2013/1/23 you wrote:<br>
&quot;That said there are still limitations with primitives and Cog.  Currently<br>
Cog only samples &quot;interpreter&quot; primitives.  Those primitives it implements<br>
in machine code (integer and float arithmetic, closure evaluation, at:,<br>
identityHash) are not sampled and won&#39;t show up; they will be charged to<br>
the calling method.&quot;.<br>
I&#39;m not sure if this is a real issue. And I don&#39;t know if this limitation<br>
applies to StackVM or InterpreterVM. Can you please clarify?<br>
<br>
Another option would be some software for that can slow down an Atom or<br>
Core processor in a reliable and predictable way, and just use Cog. So<br>
far, I couldn&#39;t find any. Suggestions welcome!<br>
<br>
Finally, I could take the dust off my XO (300MHz Geode processor) and do<br>
profiling there. It is already slow enough, and can run Cog.<br>
<br>
Thanks in advance, Eliot.<br>
<div class="im"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  Dave<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  Thanks,<br>
&gt;&gt;&gt;&gt;&gt; Juan Vuletich<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt; Juan Vuletich<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; best,<br>
&gt;&gt; Eliot<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
<br>
</div>Cheers,<br>
Juan Vuletich<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>