caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dawid Toton <d0@wp.pl>
To: caml-list@yquem.inria.fr
Subject: Re: Incremental linking
Date: Mon, 12 Oct 2009 16:36:01 +0200	[thread overview]
Message-ID: <4AD33ED1.6070804@wp.pl> (raw)
In-Reply-To: <4AC311E2.7030409@inria.fr>

> 
> Yes.  "ocamlopt -pack" actually calls "ld -r" underneath to
> consolidate several compilation units in a single .cmx/.o file.
> "ld -r" will resolve references between these compilation units.

I tried with this switch and indeed I can link a toy program by
arbitrary intermediate steps. It works OK and is good news to me.

Since today I thought that I have no way to generate the startup code
quickly, but I came to the following solution:
ocamlopt -o prog -dstartup --cc echo A.cmx B.cx C.cmx D.cmx
as -o prog.startup.o prog.startup.s

This way I have all the technical pieces working. Now I have to think
how to automate this. :)

> 
> Generally speaking, I'm somewhat surprised that linking time is an
> issue for Dawid.  Modern Unix linkers are quite fast, and the
> additional link-time work that OCaml does is small.  Let us know if
> you manage to narrow the problem.

My interest in this comes from combination of few facts: all my
calculations are done on a not very fresh machine, my code is a big tree
of small modules and I normally work this way:
1. modify some module (usually at leaf position)
2. recompile everything to native code
3. run, look at the results and go to 1.

I need therefore fast recompilation and fast linking (to stay focused on
the work). I'm about to solve the problem of ocamlbuild spending all its
time looking at unmodified modules. Then I wanted to make sure that it
will be possible to mitigate the second bottleneck.

This is why I'm happy to be able to do incremental linking.

It's helpful that the ocamlopt itself is very fast.

Dawid



  reply	other threads:[~2009-10-12 12:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 18:38 Dawid Toton
2009-09-30  8:08 ` [Caml-list] " Xavier Leroy
2009-10-12 14:36   ` Dawid Toton [this message]
2009-09-29 18:39 Dawid Toton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AD33ED1.6070804@wp.pl \
    --to=d0@wp.pl \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).