Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006389OCamlOCaml backend (code generation)public2014-05-03 15:312014-07-23 16:02
Reportergasche 
Assigned Togasche 
PrioritylowSeverityfeatureReproducibilityN/A
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006389: [github patch] add an -opaque option to produce optimization-empty .cmx file for separate native compilation
Descriptionhttps://github.com/ocaml/ocaml/pull/30 [^]

The intent of this option is to enable semi-separate native
compilation. Currently, when a module changes, all the modules that
depend on it need to be recompiled. Activating -opaque disables
cross-module optimization, but should let us change a module without
having to recompile all the others (although to be honest this still
have to be verified).

This would be of practical value for development cycles of project
that have (compile;test) loops: currently compilation is much slower
in native code than in bytecode, but tests can be sensibly faster in
native code. -opaque could bring the best of both worlds, with fast
compiles and rather-fast tests.
Additional InformationReviewers noted that the "does not recompile dependencies when implementation changes" aspect only works for build-system that are content-based rather than timestamp-based, as recompiling the .cmx will update its modification time. I think this is fine, and that changing the compilation process to please timestamp-based system is an orthogonal question that should be discussed separately.
Tagsgithub, patch
Attached Files

- Relationships
related to 0004454acknowledged Better control over cross-module optimizations 

-  Notes
(0011343)
frisch (developer)
2014-05-04 22:21

I'm in favor of accepting the patch, but it would be quite good to at least verify that it fulfills its goal (e.g. with ocamlbuild or with omake default rules).
(0011363)
frisch (developer)
2014-05-06 17:27

I've done a test on LexiFi's code base. For a given source file change and build target, compilation takes 24s without -opaque and 16s with -opaque. The gain is not huge, but we also need to link many executables (and this cannot be avoided!) and omake itself takes some time to parse and evaluate OMakefiles and check timestamp/digests (about 5s).

I assume that for some other scenarios, the gain would be more important.

Gabriel: since nobody else objected to the feature and it seems harmless, I think you can commit your patch on the trunk.
(0011364)
gasche (developer)
2014-05-06 17:54

Thanks a lot! I was busy with other things and kind of left this one by the wayside. I agree that will be a nice addition.
(0011902)
frisch (developer)
2014-07-23 16:02

Ping? Since the patch cannot break anything, I'd even push for putting it in 4.02.

- Issue History
Date Modified Username Field Change
2014-05-03 15:31 gasche New Issue
2014-05-03 15:33 gasche Tag Attached: github
2014-05-03 15:33 gasche Tag Attached: patch
2014-05-04 22:21 frisch Note Added: 0011343
2014-05-06 17:27 frisch Note Added: 0011363
2014-05-06 17:54 gasche Note Added: 0011364
2014-06-02 18:58 frisch Relationship added related to 0004454
2014-06-04 21:43 doligez Status new => confirmed
2014-06-17 16:30 frisch Assigned To => gasche
2014-06-17 16:30 frisch Status confirmed => assigned
2014-07-23 16:02 frisch Note Added: 0011902


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker