[m-rev.] diff: --optimize-constructor-last-call for list.m and tree234.m

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Oct 30 17:22:05 AEDT 2006


On Mon, 30 Oct 2006, Peter Ross wrote:

> On 10/30/06, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>> 
>> On Mon, 30 Oct 2006, Peter Ross wrote:
>> 
>> > On 10/30/06, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
>> >> library/Mercury.options:
>> >>         Turn on --optimize-constructor-last-call for list.m and 
>> tree234.m.
>> >>
>> >>         In the following, version 1 is with the original parameters,
>> >> version 2
>> >>         is with --optimize-constructor-last-call for list.m only, 
>> version 3
>> >>         is with --optimize-constructor-last-call for both modules.
>> >>
>> >>         mercury_compile.01 average of 12 with ignore=1     20.44
>> >>         mercury_compile.02 average of 12 with ignore=1     19.99
>> >>         mercury_compile.03 average of 12 with ignore=1     19.83
>> >>
>> > In my opinion all library modules should be compiled with
>> > --optimize-constructor-last-call
>> > as running slower is preferable to running out of stack.
>> 
>> If you want to ensure that you don't run out of stack with those
>> predicates that can avoid it using --optimize-constructor-last call then
>> it needs to be enabled by default for everything; otherwise some of the
>> opt imported predicates used by higher-order specialisation, and that
>> are candidates for this optimization, will be missed.
>> 
> Is that remark addressed to me or to zs?

Both, it's just something else that should be considered.

> If it is to me, the point I was trying to make is that occasionally my
> programs run out of stack in the library modules, which requires that
> one recompile the library for things to work.
>
> Thanks however for the information that one has to do it for all
> modules to avoid problems with higher-order specialisation, that
> would've been hard to track down.

I'm thinking specifically of cases where calls to list.map or similar
are the subject of higher-order specialisation.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list