Mac OS X vs. Linux: Modifier keys and performance

John M McIntosh johnmci at smalltalkconsulting.com
Mon Aug 5 21:45:47 UTC 2002


>Hola!
>
>When I switched from Mac OS X to Linux on my iBook, one of the first
>things I noticed in Linux is that Control-, Cmd- and Option-Click don't
>work in the Linux VM like they do on OS X.  Not a big issue, I can still
>get to the left and right buttons using the Enter and F11 buttons.  I've
>mostly converted my brain to making the long reach for F11 rather than
>using option-click... but why is this not in the Unix VM, out of
>curiousity?
>
>Also, it seems weird that Squeak is faster under OS X than it is in
>Linux, tinyBenchmark-wise, substantially.  On my iBook under Debian 3,
>using the 3.2-3 VM, I get:  '33402922 bytecodes/sec; 1466148 sends/sec';
>under OS X, I believe I got more like 45 million bytecodes/sec- about
>36% faster. (wow!)  It's not of huge concern, as I think I'm switching
>back to OS X for faster Squeak.   Anyone have any guesses why this
>performance disparity exists?  I originally switched *to* Linux figuring
>that it would be faster under Linux, as so much else was. :P
>
>Regards,
>Aaron

Well it's a build thing and with the addition of some changesets that 
aren't in the regular image that produces the interp.c. These 
additional changes are specific to the PPC architecture and affect 
how the GCC 2.9x compiler produces the assembler thus it does as you 
notice make a much faster VM.

The os-x VM is built using the gcc compiler which comes from Apple's 
branch of the source tree, so it should be possible to build a 
linuxppc VM that has similar performance. LinuxPPC feels faster 
because the GUI layer is faster, but bytecodes a second really 
measure the compiler optimization, I believe both platforms should 
produce a similar binary, that said I'll note

NOTE THE GCC 3.X COMPILER WILL PRODUCE A SQUEAK VM THAT HAS POOR 
PERFORMANCE!!!!
THE EXTRA ORDINARY OPTIMIZATIONS THAT GCC 3.X NOW DOES ACTUALLY 
PRODUCES A VM THAT RUNS SLOWER! SAD BUT TRUE...

So what you need to do is look at the readme in the mac vm build folder and
do:

(from the readme) Step Three: Build an interpeter

	A.  Install change sets from the specialChangeSets Folder.
		These are required to build a VM that has globals as 
a structure which improves
		performance by 10%.

		Interpreter-normalSend.1.cs
		MoreInterpAccessors-JMM.2.cs
		CheckInterruptOften-JMM.1.cs
		Globalstructure-JMM.2.cs
		CGeneratorEnhancements-ajh.1.cs
		Gnuifier.2.cs

	B.	DoIt: VMMakerTool openInWorld
	C.	Enter the Path to platforms code: (enter path to 
platforms in step two).
	D.	Enter the Platform name: (default is fine) "Mac OS"
	E.	Enter the Path for your generates sources (default is fine).
	F.	Select plugins. (Suggest selecting menu item "make 
all external",
		then drag back the following back to Plugins not built:
			FFIPlugin
			FileCopyPlugin
			IntegerPokerPlugin
			Mpeg3Plugin
			TestOSAPlugin
			RealPrintingPlugin)
	G.	Press button "Save Configuration" to save your 
configuration for later.
	H.	Press button "Generate All" to build the interpreter

For comparison, my entries were, respectively:

		powercow X:Users:werdna:Desktop:squeak:VM:squeak:platforms
		Mac OS
		powercow 
X:Users:werdna:Desktop:squeak:Squeak3.2a-4599 Folder:src

Step Four: Get, and install, the Gnifier, and gnuify the interpreter

	A.	See the Gnuifier.2.cs changeset in the specialChangeSetsFolder
	B.	DoIt:	(Gnuifier on: pathToInterpreterfile) gnuify, 
in my case:

		(Gnuifier on:
			((FileDirectory default
				directoryNamed: 'src')
				directoryNamed: 'vm') pathName) gnuify


Note the hacked sqGnu.h I've got in the specialChangeSets folder,
(that should be cleaned up someday soon, and reintegrated with the 
mainstream one).

with one change
#ifdef FOO_REG
     register struct foo * foo FOO_REG = &fum;
#else
should be in your interp.c

If you want you can send me your interp.c to check (me not the list eh?)
This should give you a VM that should give you good numbers...

Also Optimization level 3, and -mcpu=750 -funroll-loops helps too.

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list