All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@inria.fr
Subject: Re: [cocci] Very long compile times on parsing_cocci/parser_cocci_menhir.ml
Date: Thu, 2 May 2024 17:31:31 +0100	[thread overview]
Message-ID: <20240502163131.GC30267@redhat.com> (raw)
In-Reply-To: <bf4ca7f1-d732-0fc-1991-f855c0364235@inria.fr>

On Thu, May 02, 2024 at 11:44:00AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 2 May 2024, Richard W.M. Jones wrote:
> 
> > OCAMLOPT  parsing_cocci/parser_cocci_menhir.ml
> >
> > This single file takes a very long time to compile, about 34 minutes
> > on my 2 year old Intel laptop.  It's quite large too ...
> >
> > 139201 ./coccinelle-1.2/parsing_cocci/parser_cocci_menhir.ml
> >
> > I've observed in the past that the OCaml compiler doesn't handle
> > single large files well.  It seems to have some O(n^k) behaviour.
> >
> > Is this a known issue?
> 
> I agree that it's slow, but I haven't seen it take 34 minutes.

I just tried it on a much faster AMD desktop machine, but essentially
the same OCaml and menhir, and it still takes a very long time to
compile this one file: 17:35 minutes

I tried it on a (different) machine with OCaml 4.11.1 and that was
considerably faster, taking under a minute.

Rich.

> The point is that it is a parser, so the code is generated.  I use OCaml
> 4.13.1 or 5.0, not 5.1.1.  I have the same version of menhir as the one
> you mention.
> 
> I can try to make it smaller.
> 
> julia
> 
> >
> > Rich.
> >
> > coccinelle 1.2 from tarball
> > ocaml-5.1.1-4.fc40.x86_64
> > ocaml-menhir-20231231-3.fc40.x86_64
> >
> > --
> > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> > Read my programming and virtualization blog: http://rwmj.wordpress.com
> > virt-top is 'top' for virtual machines.  Tiny program with many
> > powerful monitoring features, net stats, disk stats, logging, etc.
> > http://people.redhat.com/~rjones/virt-top
> >
> >

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top


  reply	other threads:[~2024-05-02 16:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02  8:54 [cocci] Very long compile times on parsing_cocci/parser_cocci_menhir.ml Richard W.M. Jones
2024-05-02  9:01 ` Wolfram Sang
2024-05-02 16:16   ` Richard W.M. Jones
2024-05-02 17:40     ` Wolfram Sang
2024-05-02  9:44 ` Julia Lawall
2024-05-02 16:31   ` Richard W.M. Jones [this message]
2024-05-02 16:39     ` Julia Lawall
2024-05-02 16:49       ` Richard W.M. Jones
2024-05-02 17:02         ` Julia Lawall
2024-05-03 12:15           ` Richard W.M. Jones
2024-05-03 13:15             ` [cocci] Influence of build configuration parameter “--enable-flambda” on compilation of OCaml source files Markus Elfring
2024-05-03 15:50             ` [cocci] Very long compile times on parsing_cocci/parser_cocci_menhir.ml Julia Lawall
2024-05-03 16:43               ` Markus Elfring
2024-05-07  9:45               ` Richard W.M. Jones
2024-05-07  9:56                 ` Julia Lawall
2024-05-05  5:25             ` [cocci] Using OCaml compiler variants? Markus Elfring
2024-05-02 17:19         ` [cocci] Very long compile times on parsing_cocci/parser_cocci_menhir.ml Richard W.M. Jones
2024-05-02 17:31           ` Richard W.M. Jones
2024-05-02 21:41             ` Julia Lawall
2024-05-03  7:31               ` Richard W.M. Jones
2024-05-03  8:00                 ` Markus Elfring
2024-05-03 10:24                   ` Richard W.M. Jones
2024-05-03 10:40                     ` [cocci] Analysing software build processes Markus Elfring
2024-05-03 10:59                       ` Richard W.M. Jones
2024-05-03 11:15                         ` Markus Elfring
2024-05-02 10:18 ` [cocci] Checking compilation durations for “parser_cocci_menhir.ml” Markus Elfring

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=20240502163131.GC30267@redhat.com \
    --to=rjones@redhat.com \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.