MASM compiles RosAsm faster than RosAsm compiles RosAsm

From: Randall Hyde (randyhyde_at_earthlink.net)
Date: 04/29/04


Date: Thu, 29 Apr 2004 03:32:07 GMT

For a long while Rene Tournois has been telling us how
much faster RosAsm is than MASM. As "proof" of this,
he tells us that RosAsm self-compiles itself in something
like six seconds on his Celeron processor. The fact that
he has never bothered to convert the RosAsm source code
to MASM syntax in order to compare apples with apples
has been raised many times, but he still keeps spouting these
numbers as though they actually mean something.

Recently, our good a.l.a. buddy H.A.W. (half a wannabe)
has been saying that if *I* wanted to prove something,
I should convert the RosAsm source files to MASM syntax
and demonstrate how much faster MASM is. Like it's my
job to prove this for the RosAsm crowd.

However, after converting the HLA v2.0 source code to
RosAsm format (using the RosAsm disassembler) and
demonstrating that MASM is faster at assembling HLA's
source code than is RosAsm, it occured to me that I could
do the same exact thing with the RosAsm source code -
feed it through a disassembler that produces MASM
source code (e.g., IDAPro) and then measure the resulting
compile times for the two assemblers.

Running IDAPro was relatively painless. Of course, I ran
it in the "automatic" mode, so just like the RosAsm disassembler,
the code it produced was not correct. Indeed, it contained
numerous syntax errors and other issues that I had to correct
by hand (I mention this only because I blasted Rene's disassembler
in a previous post for producing bad assembly source code for
HLA v2.0, it's only fair to mention that I had the same types of
problems with IDAPro, though I should also point out that
IDAPro offers an interactive mode that lets you clean up a lot
of the problems). After a little more than about an hour's worth
of work, I got MASM to compile the disassembled RosAsm
source code.

Here are the results on my 2.6 GHz PIV machine,
SCSI320 drives, 800MHz memory bus:

MASM compiling RosAsm: 0.35 seconds
RosAsm compiling RosAsm: just under four seconds.

I cannot give an exact time for RosAsm's self compilation
because RosAsm 16b reports some sort of error at the
end of assembly and keeps counting the time until you
hit the okay button in the dialog box. I pressed it as
fast as I could (after several attempts), the reported time
was about 4.3 seconds, so I'm subtracting about a quarter
of a second or so to make up for human response time here.

At work, I found the following results (on a much slower machine,
2 GHz, slow bus, slow IDE drive, etc., your basic "cheap" PC).

MASM compiling RosAsm: 1.6 seconds
RosAsm compiling RosAsm: about six seconds (see above description).

For the longest time, Rene has been using the compilation of
RosAsm as the *only* benchmark worthy of discussion. That
being the case, then I should be able to claim that MASM is
between about four and twelve times faster than RosAsm.
Now *I'm* not going to make that claim, because my experience
with the benchmarks I've been working on don't show such a
wide gap (12x) between RosAsm and MASM for all the other
files I've produced, but for the benchmark that Rene keeps
coming back to, these are the results.

Here are some file statistics:

MASM source code for RosAsm:
approx 300,000 lines of source code.
very simple coding style (i.e., produced by a disassembler,
no macros, few named constants except for API calls,
things like that).
Approx six megabytes of source code.
"Synthetic" (according to Rene) labels that are very similar
to one another.

RosAsm source code for RosAsm:
75,000 lines of source code.
2.5 MB (according to Rene)
Lots of macros used (which is why the disassembled
code is so much bigger, the macros are all expanded).
Natural labels (which Rene claims compile a whole lot faster
with RosAsm, the choice of "natural" or "synthetic" labels
don't seem to make much of a difference to MASM).

This isn't exactly an "oranges" to "oranges" comparison.
After all, we are comparing disassembled code against the
original source code. It's more like an "oranges" to "tangerines"
comparison. To be a little more fair, we should run the disassembled
output of RosAsm through RosAsm. Rene claims that such a
compilation takes 60 seconds on is 1.3 GHz Celeron. That is,
an order of magnitude slower than the normal numbers he gets.
Therefore, if we compare disassembled RosAsm source in
RosAsm format, I'd expect RosAsm on my machine to require
about 40 seconds to do the job (an order of magnitude difference,
just like Rene found on his Celeron). This would make MASM
about 100x faster than RosAsm.

Now I don't want anyone to get the impression that I'm claiming
MASM is 100x, or even 3-12x, faster than RosAsm. That's not
the point of this demonstration. The point of this demonstration is
to lay to rest, once and for all, the myth Rene keeps trying to
propagate that MASM is a slow assembler. It is not. Every test
I've run suggests that MASM is actually a little faster than
RosAsm. However, I would point out that my testing methodology
was *not* geared towards "proving" that MASM is faster than
RosAsm, rather it was geared towards proving that RosAsm is not
way faster than MASM. That's a much easier thing to prove.
Whether or not RosAsm is much slower than MASM is an open
question. However, I can say without hesitation that RosAsm is
not many times faster than MASM. At worst, I'd suggest that
MASM and RosAsm perform comparably well.

In any case, there really is no need for additional benchmarks
in this matter. The RosAsm crowd cried for a MASM version
of RosAsm, they've been given it, and the results speak for themselves.
It will be interesting to see what new angle Rene comes up with to
attack the MASM assembler.

Cheers,
Randy Hyde
P.S., if anyone wants a copy of the MASM source code for
RosAsm to try this experiment on their machine, just email me.
I'll mail you the ZIP file, which is about 600K.


Quantcast