Some performance notes

Rob Gayvert rtg at rochester.rr.com
Wed Mar 2 12:50:45 UTC 2005


Andreas Raab wrote:

>> > Yeah. The fact that I can build the same sources with gcc and msvc, 
>> and
>> > the gcc version is twice as fast (bytecodes/sec), that's encouraging.
>> >
>> Personally, but I'm not an expert, I find it hard to believe
>> that MSVC produces code that's so crappy that gcc breezes past
>> it by a factor of 2.
>
> Actually, it isn't MSVC producing crappy code, but rather GCC 
> producing outstandingly fast code. But it doesn't do this on its own - 
> a process called "gnuification" of the VM source code is involved as 
> well (invented by Ian) which inserts certain optimizations in the VM 
> which are GNU specific and have no equivalent in MSVC (this is when 
> you get gnu-interp.c instead of interp.c and use sqGnu.h instead of 
> sq.h - have a look at these files). For example, we use labeled goto's 
> instead of a case dispatch (this is known to bring 30-50% in bytecode 
> speed alone since we're cutting out two jumps and a test per bytecode) 
> and the use of specifically assigned register variables for the most 
> heavily used local vars in interpret() doesn't hurt either.
>
> So it ain't exactly breezing but rather hard work and (literally) 
> years of profiling and measuring different options. But the speed 
> difference is real - MSVC never came even close to ballpark range 
> after I started using the gnuification process.
>
>> So assuming that Rob prefers to live in VisualStudio land, I think it
>> might be useful maybe to ask around on squeak-dev to see whether anyone
>> knows what the best MSC options are - there must be something obvious
>> that's missing...
>
> It might be useful to ask around but don't expect anything obvious to 
> "fix" this problem. Unless MS has added support for those things 
> (which is possible; I have not been following MSVC due to lack of $$$) 
> you probably won't get anywhere near the speed of the gnuified VM.
>
> Cheers,
>  - Andreas

Andreas - thanks for the detailed explanation!  This is amazing stuff. I 
suspected the gnuify process was for performance, but I had no idea it 
was this dramatic.

I do a fair amount of work with cygwin and gcc as well, so I'm not 
partial to any particular tool; I just happened to start with MSVC. But 
after seeing these numbers, I'll definitely have to switch over to a gcc 
build.






More information about the Wxsqueak mailing list