[m-dev.] preliminary MLDS performance comparisons

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 13 21:18:41 AEST 2000


I've got some preliminary performance results.

----------

First, here's a comparison of the effect of compiling via MLDS
on compilation speed.  For this comparison, I'm just using a single
version of the compiler (the one installed on hg, which was
compiled with --grade asm_fast.gc -O4 --opt-space).

Since this is a test of compilation speed, I used `-O0'.
But the effects with `-O2' are similar.

						----- User time (seconds) -----
Input file	Options		Speedup		total  front-end  back-end  gcc
inst_match.m	-c -O0				 7.3    3.7	   1.3	    2.3
inst_match.m	-c -O0 -H	30% 		 5.6    3.7        0.8      1.1
table_gen.m	-c -O0			        11.3	6.7	   2.4      2.1
table_gen.m	-c -O0 -H	20%		 9.4    6.7        1.0      1.6

The "speedup" column gives the relative improvement in user time
from using the `-H' (a.k.a. `--high-level-code') option.

----------

Second, here's a comparison of code size.
I compiled the compiler with the MLDS back-end, and compared this
with its size when compiled with the LLDS back-end

						------ size (kbytes) -------
Compiled with			Improvement	file	text     data    bss
-O2 --opt-space [*]                             5423    5331       79     44
-O2 --opt-space -H		33%		4084	4035        7     47

[*] The standard library was compiled with --intermodule-optimization.

----------

Finally, here's a comparison of the speed of the generated code.
I compared two versions of the compiler, both compiled with -O2 --opt-space,
one with the MLDS back-end (-H), the other with the LLDS back-end.
It would perhaps be more interesting to compare the speed of versions
compiled with -O5 rather than -O2, but the -O2 versions were what I
happened to have lying around.

On this comparison, the MLDS back-end was worse.

Compiled with         Input file     Options	Slowdown	user time (s)
-O2 --opt-space       inst_match.m   -C -O5			21.1
-O2 --opt-space -H    inst_match.m   -C -O5	27%		26.8
-O2 --opt-space       inst_match.m   -C -O0			 9.3
-O2 --opt-space -H    inst_match.m   -C -O0	21%		11.4

The first test (-C -O5), which got a 27% slowdown, is probably more
reflective of the overall performance, since more of the compiler's
code is exercised in that test than in the `-O0' test.

My guess is that this slowdown mainly reflects the immaturity of the
MLDS back-end.  I suspect that once we have done a bit more
performance tuning and implemented a few more optimizations in the
MLDS back-end, it will approach and perhaps even surpass the
performance for the LLDS back-end.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list