Some performance notes

Andreas Raab andreas.raab at gmx.de
Tue Mar 1 20:26:07 UTC 2005


> > 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




More information about the Wxsqueak mailing list