-
Notifications
You must be signed in to change notification settings - Fork 0
/
2003.01.07.html
161 lines (112 loc) · 6.1 KB
/
2003.01.07.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<html><body>
<a href="2002.12.31.html">Previous week</a> <a href="index.html">Up</a> <a href="2003.01.14.html">Next week</a>
<pre>
Hello,
Here is the latest Caml Weekly News, week 31 December 2002 to 07
January, 2003.
1) <a href="#1">Coyote Gulch test in Caml</a>
2) <a href="#2">Native labltk for Mac OS X</a>
<a name="1"/>======================================================================
1) Coyote Gulch test in Caml
----------------------------------------------------------------------
Some benchmark was discussed on the list (thread starting at
<a href="http://caml.inria.fr/archives/200301/threads.html">http://caml.inria.fr/archives/200301/threads.html</a>).
Someone asked and Xavier Leroy said:
> Is it normal that my ocaml program is only 2 times faster than the java
> counterpart ?(using the same method and complied into native. jdk is 1.4.1
You know, many compiler researchers would kill their whole families to
get speedups by a factor of 2 :-)
James Gosling gave a talk at INRIA recently where he repeated the
party line that JDK 1.4 runs as fast, or even faster, than C++.
So, by transitivity, you're implying that OCaml is twice as fast as C++.
Yippee!
More seriously: Java is nowhere as fast as a good C++ compiler (see
e.g. <a href="http://www.coyotegulch.com/reviews/almabench.html">http://www.coyotegulch.com/reviews/almabench.html</a> for an
independent, cross-language benchmark in numerical computing),
but it's not that slow either. A factor of 2 slower than ocamlopt
sounds broadly reasonable, especially if the program doesn't stress
the GC too much. Bagley's shootout (<a href="http://www.bagley.org/~doug/shootout/">http://www.bagley.org/~doug/shootout/</a>)
seems to suggest a larger factor (JDK 1.3 slightly slower than OCaml
bytecode), but his figures may be lowered by Java's slow start-up times.
Then Chet Murthy asked and Shawn Wagner announced:
> If anybody's ported this to Caml, I'd love to get a copy.
<a href="http://raevnos.pennmush.org/code/almabench-ocaml.tar.gz">http://raevnos.pennmush.org/code/almabench-ocaml.tar.gz</a>
It's pretty much a straight translation of the C++ version, and not very
impressive speed-wise on my system compared to the C++ one.
To which Xavier Leroy answered:
Thanks a lot for the OCaml translation. As you say, the speed of the
OCaml version is about 50% of that of the C++ version, both on Athlon
with g++, and on Alpha with the Tru64 cxx compiler. This is both
reassuring and disappointing:
Reassuring, because our blanket performance statement "OCaml
delivers at least 50% of the performance of a decent C compiler" is
not invalidated :-)
Disappointing, because the assembly code generated by ocamlopt isn't
too ugly despite the code not being very Caml-ish in style. In
particular, (almost) all float and ref boxing is correctly eliminated.
Given this, I was expecting maybe 75% of the performances of C++, not
50%. Simple hand optimization (CSE, loop unrolling) doesn't affect
the speed significantly. Apparently, the ocamlopt-generated code
offers less instruction-level parallelism than the g++-generated code
for the float computations. Still, I haven't really understood where
the factor of 2 comes from.
<a name="2"/>======================================================================
2) Native labltk for Mac OS X
----------------------------------------------------------------------
Ken Wakita announced:
(the patches mentioned in the message are available at
<a href="http://caml.inria.fr/archives/200301/msg00029.html">http://caml.inria.fr/archives/200301/msg00029.html</a>)
Today I found some time to install Tcl/Tk for Aqua, which is the native user
interface for Macintosh OS X and configured ocaml-3.06 so that its labltk
links with the Tcl/Tk for Aqua.
labltk, ocamlbrowser, and accompanying examples (hello, eyes, tetris, ...)
under otherlibs/labltk/examples_labltk compiles with little problem.
With a small effort you could make a clickable native application for Mac OS
X.
Though behavior of some applications is weird (some, for instance
ocamlbrowser, are very weird) but I can tolerate.
The following is an outline of installation steps (Mac OS 10.2.2 and higher
is expected):
0. Visit "www.tcl.tk" and get TclTkAqua_8.4.1-Jaguar.dmg, and install it.
After installation make four symbolic links as show followingly (you need to
be a super user):
/Library/Frameworks/Tcl.framework:
lr-xr-xr-x 1 root staff 11 Jan 7 18:58 libtcl -> libtcl8.4.a
lr-xr-xr-x 1 root staff 16 Jan 7 18:58 libtcl8.4.a -> Versions/8.4/Tcl
/Library/Frameworks/Tk.framework:
lr-xr-xr-x 1 root staff 10 Jan 7 18:58 libTk -> libTk8.4.a
lr-xr-xr-x 1 root staff 15 Jan 7 18:58 libTk8.4.a -> Versions/8.4/Tk
1. Extract ocaml-3.06.tgz and apply the attached patch (tcltk4aqua.patch)
cd ocaml-3.06; patch -p1 tcltk4aqua.patch
2. Execute the configuration script
sh ocaml4darwin.conf
This script configures ocaml-3.06 for Mac OS X and for the Tcl/Tk just
installed. It also builds "world, opt, and opt.opt".
You might want to save the existing ocaml-3.06 installation. In that case,
modify the script appropriately.
3. Install the ocaml-3.06 system
make install
4. Store makeapp.sh and Info.plist at the labltk's examples directory and
build clickable applications.
4.1 store makeapp.sh and Info.plist in "otherlibs/labltk/examples_labltk"
directory.
4.2 build examples
cd otherlibs/labltk/examples_labltk
make
4.3 build clickable applications
./makeapp hello
./makeapp tetris
...
4.4 locate the Finder application to the examples_labltk directory and start
the clickable applications.
Good luck
======================================================================
Old cwn
----------------------------------------------------------------------
If you happen to miss a cwn, you can send me a message
(alan.schmitt@inria.fr) and I'll mail it to you, or go take a look at
the archive (<a href="http://pauillac.inria.fr/~aschmitt/cwn/">http://pauillac.inria.fr/~aschmitt/cwn/</a>). If you also wish
to receive it every week by mail, just tell me so.
======================================================================
Alan Schmitt
</pre></body></html>