[MLton] Re: PIC in amd64 assembly

Wesley W. Terpstra terpstra at gmail.com
Wed Jul 30 01:07:47 PDT 2008


On Mon, Jul 28, 2008 at 1:30 PM, Wesley W. Terpstra <terpstra at gmail.com>wrote:

> PIC code actually improves performance in all but one very rare case that
> I've made conditional based on if the output format is a library.
>

Well, it seems to improve executable size by about 2%, but has not
measurable affect on performance. I've succeeded in running the entire
regression suite and a full MLton build in both executable and library form,
so I think the modified assembly is ok. For reference, here is the
difference in file sizes and execution times for the benchmark tests. The
tensor result was not reproducible.

MLton0 -- /usr/bin/mlton
MLton1 -- /home/terpstra/mlton/build/bin/mlton
run time ratio
benchmark         MLton0 MLton1
barnes-hut          1.00   1.00
boyer               1.00   1.01
checksum            1.00   1.00
count-graphs        1.00   1.00
DLXSimulator        1.00   1.00
fft                 1.00   1.00
fib                 1.00   0.99
flat-array          1.00   1.00
hamlet              1.00   1.00
imp-for             1.00   1.00
knuth-bendix        1.00   1.01
lexgen              1.00   1.00
life                1.00   1.00
logic               1.00   1.00
mandelbrot          1.00   0.98
matrix-multiply     1.00   1.00
md5                 1.00   1.00
merge               1.00   0.99
mlyacc              1.00   1.00
model-elimination   1.00   1.00
mpuz                1.00   1.00
nucleic             1.00   1.00
output1             1.00   1.00
peek                1.00   1.05
psdes-random        1.00   0.97
ratio-regions       1.00   1.00
ray                 1.00   1.00
raytrace            1.00   1.00
simple              1.00   1.00
smith-normal-form   1.00   1.00
tailfib             1.00   1.00
tak                 1.00   1.00
tensor              1.00   1.14
tsp                 1.00   0.99
tyan                1.00   1.00
vector-concat       1.00   0.99
vector-rev          1.00   1.00
vliw                1.00   1.00
wc-input1           1.00   0.96
wc-scanStream       1.00   1.00
zebra               1.00   1.02
zern                1.00   1.00
size
benchmark            MLton0    MLton1
barnes-hut          166,333   164,541
boyer               218,916   214,324
checksum             98,692    98,372
count-graphs        124,724   123,716
DLXSimulator        201,687   199,191
fft                 121,394   120,706
fib                  98,628    98,324
flat-array           98,084    97,812
hamlet            1,509,072 1,480,528
imp-for              98,372    98,068
knuth-bendix        177,383   174,743
lexgen              291,254   286,374
life                122,660   121,860
logic               182,916   181,444
mandelbrot           98,244    97,972
matrix-multiply     100,388    99,940
md5                 132,679   131,543
merge               100,036    99,716
mlyacc              663,302   654,902
model-elimination   866,113   851,409
mpuz                104,660   104,244
nucleic             274,691   269,571
output1             141,379   139,795
peek                138,199   136,663
psdes-random        101,524   101,012
ratio-regions       125,860   124,756
ray                 249,951   246,015
raytrace            378,729   373,129
simple              348,096   341,680
smith-normal-form   276,727   272,359
tailfib              98,116    97,812
tak                  98,676    98,372
tensor              167,762   165,794
tsp                 145,462   144,070
tyan                217,959   214,487
vector-concat       100,020    99,700
vector-rev           99,620    99,252
vliw                528,453   520,453
wc-input1           169,601   167,185
wc-scanStream       175,633   173,201
zebra               217,591   216,199
zern                136,013   134,893
compile time
benchmark         MLton0 MLton1
barnes-hut          8.77   8.07
boyer               8.50   8.56
checksum            6.27   6.35
count-graphs        6.82   6.92
DLXSimulator        8.67   8.86
fft                 6.66   6.69
fib                 6.25   6.26
flat-array          6.28   6.28
hamlet             35.31  37.89
imp-for             6.32   6.40
knuth-bendix        7.73   7.84
lexgen             10.12  10.08
life                6.79   6.84
logic               8.06   8.09
mandelbrot          6.28   6.36
matrix-multiply     6.30   6.41
md5                 7.02   7.00
merge               6.28   6.38
mlyacc             21.76  22.13
model-elimination  20.14  20.65
mpuz                6.46   6.49
nucleic             9.58   9.44
output1             7.06   7.07
peek                7.08   7.08
psdes-random        6.28   6.38
ratio-regions       7.42   7.63
ray                 9.43   9.41
raytrace           12.71  12.33
simple             10.83  10.84
smith-normal-form   9.38   9.48
tailfib             6.33   6.34
tak                 6.27   6.24
tensor              8.48   8.49
tsp                 7.31   7.28
tyan                8.99   9.08
vector-concat       6.20   6.34
vector-rev          6.29   6.31
vliw               15.92  16.05
wc-input1           7.62   7.84
wc-scanStream       7.79   8.02
zebra               9.19   9.06
zern                7.02   7.10
run time
benchmark         MLton0 MLton1
barnes-hut         14.83  14.85
boyer              44.68  44.98
checksum           14.96  14.96
count-graphs       22.08  21.99
DLXSimulator       22.41  22.49
fft                12.69  12.74
fib                32.96  32.78
flat-array         21.55  21.56
hamlet             41.78  41.75
imp-for            22.39  22.35
knuth-bendix       20.71  20.96
lexgen             18.20  18.24
life               22.89  22.89
logic              20.15  20.13
mandelbrot         17.45  17.06
matrix-multiply    32.28  32.36
md5                28.05  27.96
merge              37.35  36.98
mlyacc             21.18  21.21
model-elimination  32.01  32.08
mpuz               19.66  19.68
nucleic            15.21  15.17
output1            30.85  30.93
peek               18.12  19.07
psdes-random       13.22  12.81
ratio-regions     100.76 101.11
ray                12.23  12.27
raytrace           14.33  14.34
simple             22.80  22.75
smith-normal-form   4.95   4.95
tailfib            18.21  18.26
tak                27.08  27.08
tensor             19.11  21.70
tsp                19.38  19.23
tyan               23.37  23.37
vector-concat      22.96  22.84
vector-rev         29.38  29.40
vliw               19.68  19.64
wc-input1          29.64  28.52
wc-scanStream      23.43  23.36
zebra              25.37  25.82
zern               18.41  18.37
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20080730/30682e5a/attachment.html


More information about the MLton mailing list