From: Alain Frisch <alain@frisch.fr>
To: "Milan Stanojević" <milanst@gmail.com>, "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] empty mli for executable
Date: Thu, 03 Oct 2013 19:45:07 +0200 [thread overview]
Message-ID: <524DAD23.7070206@frisch.fr> (raw)
In-Reply-To: <CAKR7PS_7qKvQUx1tm2DaSJWZG-viDhfbdRLTrYB1yxE=Vq6Upw@mail.gmail.com>
On 10/03/2013 06:50 PM, Milan Stanojević wrote:
> ocaml compiler executables have empty mlis with the following comment
> (*
> this "empty" file is here to speed up garbage collection in ocamlopt.opt
> *)
>
> Can someone explain this in more detail?
> How does empty interface lead to faster gc-ing?
The empty interface implies that toplevel values computed by those
modules don't need to be stored in the global symbol slots. Those slots
are roots for the GC and are thus scanned every time it runs. The fewer
global symbols, the quicker the GC will be. Well, this is the theory,
I'd be really surprised if this materialized in a speed up which can be
observed.
Having an empty interface has a much more practical interest, in
general: it allows the compiler to detect unused declarations in the
implementation (if the corresponding warnings are enabled), and thus to
reduce code rot.
-- Alain
next prev parent reply other threads:[~2013-10-03 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 16:50 Milan Stanojević
2013-10-03 17:45 ` Alain Frisch [this message]
2013-10-03 18:42 ` Milan Stanojević
2013-10-03 20:52 ` Alain Frisch
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=524DAD23.7070206@frisch.fr \
--to=alain@frisch.fr \
--cc=caml-list@inria.fr \
--cc=milanst@gmail.com \
/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