Re: Compile-time v. execution-time tradeoff
Matthew Fluet <[email protected]> Wed, 17 Feb 2016 06:55:51 -0500
| Newsgroups | gmane.comp.lang.ml.mlton.user |
|---|---|
| Message-ID | <CAMrhFL5orqb1OzvnWdN2d5+V2ZnQpAnbzTJ3c6WnusGEdvHT-Q@mail.gmail.com> |
On Tue, Feb 16, 2016 at 8:49 AM, Rob Arthan <[email protected]> wrote: > Does MLton have any options that let me trade off execution time against compile time? The scenario is that I have a parser generator that I have recently ported to run on MLton. The parser generator itself is very efficient when built with MLton, but the test suite runs slowly because of the time taken to compile the generated parsers. As the tests only run each parser once, it would be nice if I could speed up the tests by opting for less optimisation. I tried -inline 0, but it didn’t make much difference. MLton doesn't currently have distinct optimization levels. The "-drop-pass" option can be used to skip a particular optimization pass. The "-ssa-passes" option (and similarly for the other IRs) can be used to set a particular sequence of optimization passes; "-ssa-passes minimal" is recognized and will only execute those passes necessary for correctness. Unfortunately, while this speeds up the time in the SSA optimizations, it tends to slow down the codegen significantly, since the program hasn't be simplified. There is also a minimum of time that any compile takes, due to the whole-program compilation requiring scanning, parsing, and elaborating the whole Basis Library in addition to the program of interest. You could try compiling one of your representative tests with "-verbose 2", which will give timings for all of the optimization passes. If a particular pass is taking very long, then you can use "-drop-pass" to skip that one. Occasionally, performance bugs in the optimization passes have turned up, especially when presented with stylistically distinct code, such as might appear in parser generator output. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ MLton-user mailing list [email protected]; [email protected] https://lists.sourceforge.net/lists/listinfo/mlton-user