[Rubyinstaller-devel] Some thoughts about VC++ 2008

Luis Lavena luislavena at gmail.com
Thu Jan 17 06:54:06 EST 2008

Hello List,

Discussed previously with Will Rogers about using VC++ 2008 (VC9,
Express Edition), I decided to download the ISO and give it a whirl.

Leaving all the "build every extension with VC9" outside of the
discussion for a moment, lets  compare different builds of ruby in the
same system.

These results are based on a simple, not optimized sudoku solver that
I've used previously to compare Ruby builds and started a "my ruby is
faster than yours" discussion in ruby-talk a few months back, anyway:

Sudoku: http://pastie.caboo.se/92995
Benchmarks: http://pastie.caboo.se/pastes/95210

This time, I'm at home computer (Dual Core E2160, 1GB RAM, Windows XP
SP2), so I did the standard bench for VC6 build and took it as base:

Note: all the versions of ruby were build with --with-winsock2
--disable-install-doc configuration switches, no other optimization or

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
mean elapsed time (5 runs): 16.550 sec.

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32_90]
mean elapsed time (5 runs): 12.272 sec.

Comparing both VC6 vs VC9, we have a 25.84% performance boost, not bad.

But, I decided to try the other platforms available, MinGW and VC8
too, since I have the Windows Vista SDK Update also installed:

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32_80]
mean elapsed time (5 runs): 12.281 sec.

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mingw32]
mean elapsed time (5 runs): 11.306 sec.

Mmm, something funny, it seems VC8 do not differ from VC9 generated
code, and it loss against MinGW (and we are talking of GCC 3.4.5
(mingw special build))...

Not GCC version 4... what the heck, let's try it...

So, I put my helmet and downloaded the experimental GCC 4.2.1 (dw2):

gcc version: 4.2.1-dw2 (mingw32-2)

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mingw32]
mean elapsed time (5 runs): 11.0 sec.

That's 33.54% performance boost compared with standard VC6 Ruby... and
VC9 loss this battle, again.

So I wonder if VC8/9 is something good in the long run.

Please, now add to the equation all the troubles tweaking the
dependencies makefiles to make them compatible with MSVCR80/90 and
that we must manually build all them *just for ruby*, and not using
the standard ones, diverging from upstream maintainers.

Still thinking worth the effort?

Some users will argue that "with VC8/9 we can have 64bits builds"...
and that is true, except that we will also need to fix the
dependencies to properly build for 64bits.

There is also MinGW 64bits, just in case:

Still need to undust my copy of Windows XP SP2 x86_64 (or x64 Edition)
to test it.


Luis Lavena
Multimedia systems
A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams

More information about the Rubyinstaller-devel mailing list