Now that we have working versions of our new native OCaml toplevel ocamlnat without toolchain dependencies for both i386 and amd64, I decided to run a few benchmarks, comparing our ocamlnat to OCaml 3.12.1 (both the byte code toplevel and the ocamlnat that silently ships with 3.12.1) and to our byte-code just-in-time compiler OCamlJIT2.
The benchmarks used are test programs from the testsuite/tests folder of the OCaml 3.12.1 distribution. They do more or less represent typical OCaml applications. The almabench, fft and nucleic programs are floating point benchmarks, quicksort and sorts are sorting algorithms, and the remaining are miscellaneous benchmarks. The programs were run on different platforms, measuring the combined user + system time for the process itself and all its child processes (only relevant for the oldocamlnat which invokes toolchain programs).
Below is the resulting speedup of the different toplevels compared to the ocaml byte code toplevel, with OCamlNat/ext being the oldocamlnat with the toolchain dependencies that ships with OCaml 3.12.1 and OCamlNat/jit being our new implementation available from the ocamlnat-jit branch of my ocaml-experimental repository.
As you can see, the speedup is quite impressive with our native toplevel being up to 100 times faster than the byte code toplevel. It is however worth noting that this is in part due to the fact that llvm-gcc is now the default with OS X, which disables the register assignment optimization in the byte code interpreter.
If you want to try our new toplevel (and/or help with testing), you can always grab the latest source from my ocaml-experimental repository using the following command
$./configure -prefix /path/to/ocamlnat-jit
$make world opt ocamlnat
$make install
similar to the regular OCaml distribution. This will install a fully functional OCaml 3.12.1 system to /path/to/ocamlnat-jit together with a new binary ocamlnat, our native toplevel. You should be able to use ocamlnat as a drop-in replacement for ocaml in almost every case, unless you really need the byte code runtime (i.e. Coq is one popular application that heavily depends on the byte code runtime).
Imagine you want to connect via SSH to remote systems hostB and hostC on an intranet behind hostA. This could be achieved easily using port forwarding via hostA, just pick two arbitrary ports on the local machine and forward them to ports 22 of hostB and hostC. This works very well for a small amount of intranet hosts, but it get’s quite messy as the list of hosts grows. After some time you’ll have a rather huge amount of local ports to remember (or to lookup in your port forwarding script several times a day). It’d certainly be easier to just type ssh hostB and have the tunnel setup automatically.
Fortunately that is very well possible and quite easy to achieve using the ProxyCommand directive. Assuming hostA has nc installed, you can just add the following lines to your $HOME/.ssh/config.
Once done, you can easily connect to hostB via ssh hostB, or hostC via ssh hostC. No need to setup the tunnel first, it’ll be set up and teared down automagically as needed.
I recently imported the first working version of the Linear Scan Register Allocator for the OCaml Native Code Compiler ocamlopt into the linear-scan-register-allocator branch of my ocaml-experimental repository. The register allocator was implemented for ocamlopt by Marcell Fischbach as part of his diploma thesis. It presents a first step towards a (better) native OCaml toplevel ocamlnat. Use the following command to checkout the source code:
The implementation of the linear scan register allocator can be found in asmcomp/interval.ml, asmcomp/interval.mli, asmcomp/linscan.ml and asmcomp/linscan.mli (integrated into ocamlopt via asmcomp/asmgen.ml).
Some initial timing results are available here, here, and here. See bug 5324 for additional details.
During the last two days I managed to setup a GitHubmirror of OCaml. It works by importing the changes from the official OCaml Subversion Repository using git-svn and pushing them to the GitHub mirror. This is done automatically every hour by one of my servers. It works by setting up a Git branch for every version Subversion branch and a Git branch with a tags/ prefix for every tags Subversion branch. Also note that the master branch is called trunk.
I wanted to do this for some time now, but as some of you know, time is always against us. The major advantage is that there is now a single Git base for all my OCaml projects (and that of others), and there’s is no longer a need to fiddle with git-svn in each and every project. Feel free to fork my ocaml repository for your own needs.