From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 0EB05820A1 for ; Fri, 6 Sep 2013 18:30:52 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Xavier.Leroy@inria.fr) identity=pra; client-ip=212.27.42.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="Xavier.Leroy@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Xavier.Leroy@inria.fr) identity=mailfrom; client-ip=212.27.42.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="Xavier.Leroy@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp3-g21.free.fr) identity=helo; client-ip=212.27.42.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="Xavier.Leroy@inria.fr"; x-sender="postmaster@smtp3-g21.free.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqUAAKsCKlLUGyoDlGdsb2JhbABbwm+Cc4EmFg4BAQEBBw0JCRQDJYIkAQEEAVMZCgIGCwshFg8JAwIBAgFFEwgBAYd4Cr4OkAMWhAcDl3WGLI5c X-IPAS-Result: AqUAAKsCKlLUGyoDlGdsb2JhbABbwm+Cc4EmFg4BAQEBBw0JCRQDJYIkAQEEAVMZCgIGCwshFg8JAwIBAgFFEwgBAYd4Cr4OkAMWhAcDl3WGLI5c X-IronPort-AV: E=Sophos;i="4.90,855,1371074400"; d="scan'208";a="25987475" Received: from smtp3-g21.free.fr ([212.27.42.3]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Sep 2013 18:30:50 +0200 Received: from [192.168.1.2] (unknown [82.237.71.191]) by smtp3-g21.free.fr (Postfix) with ESMTP id 6C145A6278 for ; Fri, 6 Sep 2013 18:30:47 +0200 (CEST) Message-ID: <522A0336.7030203@inria.fr> Date: Fri, 06 Sep 2013 18:30:46 +0200 From: Xavier Leroy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: caml-list@inria.fr References: <5229DEF9.7040706@inria.fr> In-Reply-To: <5229DEF9.7040706@inria.fr> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Accelerating compilation On 06/09/13 15:56, Romain Bardou wrote: > 1) Separate typing and code generation, in ocamlc and in ocamlopt > For instance, provide an option -typing-only which would mean "only > produce the .cmi but do not produce the .cmo or the .cmx". I strongly suspect that bytecode generation takes much less time than parsing and typechecking, so you wouldn't gain much compared to simply compiling to bytecode. Some obvious recommendations: - Make sure the .opt compilers (ocamlc.opt, ocamlopt.opt) are installed. They are significantly faster than their non-.opt counterparts, and some Linux distros package the .opt compilers separately and don't install them by default. - Put your project on a fast disk, ideally a SSD. ocamlc can be I/O bound sometimes. The only times where I observe somewhat slow compilations is when I work in an NFS partition mounted from our super-reliable-but-rather-slow NAS. > 2) Be able to disable Ocamlbuild's digest mechanism and use dates and > file sizes instead > > If I am not mistaken, this is one of the main reasons why Ocamlbuild is > slower that make. It's one possible reason among others, e.g. that ocamlbuild runs ocamldep very often. Again, some profiling would help understanding the bottleneck(s). But this is a reasonable suggestion. > 3) Parallel compilation in Ocamlbuild > Of course it would help but it is not easy to implement so I'm just > putting it there to be exhaustive. As others said, ocamlbuild has some support for parallelism, but it's much less effective than "make -j". One reason could be that ocamlbuild discovers dependencies as it goes, so it's doing online scheduling, in contrast with make's offline scheduling. But within the online scheduling approach, there is certainly room for improvement. Suggestions and patches welcome. - Xavier Leroy