[m-dev.] MLDS back-end status

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 17 05:27:34 AEDT 1999


I can now compile the following standard library modules with the
MLDS back-end:

	assoc_list.m bag.m bimap.m bintree.m bintree_set.m bool.m
	bt_array.m dir.m eqvclass.m getopt.m group.m integer.m
	lexer.m list.m map.m multi_map.m ops.m parser.m pqueue.m
	prolog.m queue.m random.m rational.m rbtree.m relation.m
	set.m set_bbbtree.m set_ordlist.m set_unordlist.m stack.m
	term_io.m tree234.m varset.m

Whether or not the generated code is correct or not is another
question, but it at least gets past the C compiler with --no-warn ;-).

The major features that need to be done before the compiler can
bootstrap with the MLDS back-end are:
	- handling no_tag types (easy)
	- generation of base_type_info constants (fairly easy)
	- support for the C interface
	- rewriting the parts of the standard library / runtime that
	  make assumptions about our code generation model

I also did some benchmarking of compilation time, compiling list.m
with various flags.  Beware that this is very much an
apples vs oranges comparison, since the MLDS back-end does not yet
implement RTTI, which accounts for a significant amount of compilation
time, and nor does it handle tabling, trailing, --gc none, --gc accurate,
or debugging; the code for those features adds a bit to the cost of
compilation even if those features are not used.  Furthermore list.m
is probably atypical, since it imports very few other modules.
But hey, here are the results anyway.  They may be useful as a
"guaranteed not to exceed" kind of measurement.  Use at own risk.

				MLDS backend	LLDS backend
	--error-check-only	2.1		2.1
	-C -O0 --high-level-c	2.7		3.1
	-c -O0 --high-level-c	4.6		6.0
	-C -O2 --high-level-c 	2.9		3.5
	-c -O2 --high-level-c 	5.9		7.7

Extrapolating from that gives the following *rough* times
for the different phases:

	front-end		2.1		2.1
	back-end -O0		0.6		1.0
	C compiler -O0		1.9		2.9

	front-end		2.1		2.1
	back-end -O2		0.8		1.4
	C compiler -O2		3.0		4.2


Cheers,
	Fergus.

P.S.  I enclose below a log of the raw times.

fjh$ ttime 8 mchg -C --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O0 list.m
2.880u 0.060s 0:03.52 83.5%     0+0k 0+0io 1063pf+0w
2.880u 0.070s 0:03.15 93.6%     0+0k 0+0io 1063pf+0w
2.900u 0.070s 0:03.20 92.8%     0+0k 0+0io 1063pf+0w
3.020u 0.070s 0:03.18 97.1%     0+0k 0+0io 1063pf+0w
2.900u 0.060s 0:03.24 91.3%     0+0k 0+0io 1063pf+0w
2.930u 0.090s 0:03.14 96.1%     0+0k 0+0io 1063pf+0w
3.010u 0.080s 0:03.65 84.6%     0+0k 0+0io 1063pf+0w
2.910u 0.050s 0:03.05 97.0%     0+0k 0+0io 1063pf+0w
<1 hg:/d-drive/home/hg/fjh/mercury/stage2/library 04:36:06 1611>
fjh$ ttime 8 mchg -C --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O0 --high-level-c list.m
2.520u 0.090s 0:02.81 92.8%     0+0k 0+0io 1034pf+0w
2.450u 0.120s 0:02.65 96.9%     0+0k 0+0io 1034pf+0w
2.500u 0.080s 0:02.79 92.4%     0+0k 0+0io 1034pf+0w
2.540u 0.080s 0:02.80 93.5%     0+0k 0+0io 1034pf+0w
2.430u 0.110s 0:02.82 90.0%     0+0k 0+0io 1034pf+0w
2.630u 0.040s 0:02.78 96.0%     0+0k 0+0io 1034pf+0w
2.440u 0.110s 0:02.72 93.7%     0+0k 0+0io 1034pf+0w
2.620u 0.070s 0:02.78 96.7%     0+0k 0+0io 1034pf+0w
fjh$ ttime 8 mchg -C --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O2 --high-level-c list.m
2.760u 0.060s 0:04.11 68.6%     0+0k 0+0io 1068pf+0w
2.760u 0.070s 0:03.00 94.3%     0+0k 0+0io 1068pf+0w
2.760u 0.060s 0:03.25 86.7%     0+0k 0+0io 1068pf+0w
2.870u 0.050s 0:03.02 96.6%     0+0k 0+0io 1068pf+0w
2.880u 0.070s 0:03.20 92.1%     0+0k 0+0io 1068pf+0w
2.730u 0.100s 0:02.94 96.2%     0+0k 0+0io 1068pf+0w
2.800u 0.100s 0:03.10 93.5%     0+0k 0+0io 1068pf+0w
2.740u 0.100s 0:02.93 96.9%     0+0k 0+0io 1068pf+0w
<1 hg:/d-drive/home/hg/fjh/mercury/stage2/library 04:37:27 1614>
fjh$ ttime 8 mchg -C --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O2 list.m
3.420u 0.070s 0:03.78 92.3%     0+0k 0+0io 1113pf+0w
3.300u 0.100s 0:03.52 96.5%     0+0k 0+0io 1113pf+0w
3.300u 0.080s 0:03.57 94.6%     0+0k 0+0io 1113pf+0w
3.370u 0.080s 0:03.56 96.9%     0+0k 0+0io 1113pf+0w
3.430u 0.090s 0:04.35 80.9%     0+0k 0+0io 1113pf+0w
3.370u 0.060s 0:03.57 96.0%     0+0k 0+0io 1113pf+0w
3.340u 0.080s 0:03.60 95.0%     0+0k 0+0io 1113pf+0w
3.360u 0.080s 0:03.63 94.7%     0+0k 0+0io 1113pf+0w
fjh$ ttime 8 mchg -c --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O0 --high-level-c list.m
3.570u 0.260s 0:04.64 82.5%     0+0k 0+0io 2193pf+0w
3.710u 0.100s 0:04.59 83.0%     0+0k 0+0io 2193pf+0w
3.710u 0.140s 0:04.82 79.8%     0+0k 0+0io 2193pf+0w
3.650u 0.140s 0:06.63 57.1%     0+0k 0+0io 2193pf+0w
3.740u 0.160s 0:05.07 76.9%     0+0k 0+0io 2193pf+0w
3.700u 0.100s 0:04.83 78.6%     0+0k 0+0io 2193pf+0w
3.700u 0.170s 0:04.64 83.4%     0+0k 0+0io 2193pf+0w
3.670u 0.180s 0:04.96 77.6%     0+0k 0+0io 2193pf+0w
fjh$ ttime 8 mchg -c --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O0 list.m
5.110u 0.230s 0:06.29 84.8%     0+0k 0+0io 2337pf+0w
5.250u 0.140s 0:06.13 87.9%     0+0k 0+0io 2337pf+0w
5.130u 0.170s 0:06.16 86.0%     0+0k 0+0io 2337pf+0w
5.140u 0.210s 0:06.04 88.5%     0+0k 0+0io 2337pf+0w
5.190u 0.210s 0:06.20 87.0%     0+0k 0+0io 2337pf+0w
5.270u 0.140s 0:06.30 85.8%     0+0k 0+0io 2337pf+0w
5.200u 0.140s 0:06.14 86.9%     0+0k 0+0io 2337pf+0w
5.280u 0.120s 0:06.20 87.0%     0+0k 0+0io 2337pf+0w
fjh$ ttime 8 mchg -c --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O2 --high-level-c list.m
4.930u 0.200s 0:06.91 74.2%     0+0k 0+0io 2311pf+0w
5.030u 0.150s 0:06.09 85.0%     0+0k 0+0io 2311pf+0w
4.990u 0.150s 0:06.00 85.6%     0+0k 0+0io 2311pf+0w
4.970u 0.130s 0:06.23 81.8%     0+0k 0+0io 2311pf+0w
4.980u 0.150s 0:05.87 87.3%     0+0k 0+0io 2311pf+0w
5.040u 0.240s 0:06.05 87.2%     0+0k 0+0io 2311pf+0w
5.030u 0.170s 0:05.95 87.3%     0+0k 0+0io 2311pf+0w
4.940u 0.180s 0:06.14 83.3%     0+0k 0+0io 2311pf+0w
<1 hg:/d-drive/home/hg/fjh/mercury/stage2/library 04:33:39 1605>
fjh$ ttime 8 mchg -c --no-line-numbers --cflags "--no-warn -Wno-write-strings -I ../../tests/benchmarks" -O2 list.m
6.700u 0.150s 0:08.46 80.9%     0+0k 0+0io 2444pf+0w
6.760u 0.210s 0:07.74 90.0%     0+0k 0+0io 2444pf+0w
6.750u 0.180s 0:08.10 85.5%     0+0k 0+0io 2444pf+0w
6.860u 0.180s 0:07.89 89.2%     0+0k 0+0io 2444pf+0w
6.750u 0.200s 0:07.80 89.1%     0+0k 0+0io 2444pf+0w
6.820u 0.210s 0:07.95 88.4%     0+0k 0+0io 2444pf+0w
6.800u 0.170s 0:07.99 87.2%     0+0k 0+0io 2444pf+0w
6.820u 0.230s 0:09.71 72.6%     0+0k 0+0io 2444pf+0w

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