Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camlp4Ast.ml takes very long to compile #5633

Closed
vicuna opened this issue Jun 4, 2012 · 4 comments
Closed

Camlp4Ast.ml takes very long to compile #5633

vicuna opened this issue Jun 4, 2012 · 4 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Jun 4, 2012

Original bug ID: 5633
Reporter: @garrigue
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:07:02Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.0+dev
Fixed in version: 4.00.0+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Related to: #5442

Bug description

The file is 6000 lines long, but this still seems too much.
I have not yet investigated the cause.
(For all I know, I might even be the cause...)

@vicuna
Copy link
Author

vicuna commented Jun 7, 2012

Comment author: @garrigue

The source of slowness is camlp4boot.byte.
It takes 3mn on a Core i7 at 2.7G...

I kind of wonder why one has to apply camlp4 on a file that is already output by camlp4...

@vicuna
Copy link
Author

vicuna commented Jun 7, 2012

Comment author: @johnwhitington

More worryingly, the peak memory usage when compiling these slow camlp4 sections is 760Mb here (OS X, 64-bit).

@vicuna
Copy link
Author

vicuna commented Jun 8, 2012

Comment author: @xavierleroy

A wild guess: this sounds suspiciously like the Camlp4 slowdown which was fixed by commits r12391 (in trunk) and r12415 (in 4.00 branch). However, it seems that Camlp4 was not bootstrapped since then, so maybe the bootstrapped Camlp4 still contains this particular slowdown. Could someone knowledgeable with Camlp4 do a bootstrap cycle and tell us if it makes any difference?

@vicuna
Copy link
Author

vicuna commented Jun 19, 2012

Comment author: @garrigue

Indeed, the problem seems to disappear with a bootstrap cycle (explained in build/camlp4-bootstrap-recipe.txt).
Note however that the fix to #5442 was fragile: it disappeared with each camlp4 bootstrap!
I fixed that by moving the changes to camlp4/Camlp4Filters/Camlp4MetaGenerator.ml.
As a result, escaping applies not only to Expr but also to the Patt submodule, which was not escaped before.
I don't know whether this is the right behavior (it makes sense at least).

Changes committed in trunk and 4.00 at revisions 12615 and 12617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants