[mercury-users] Strange performance anomaly; can anyone confirm?

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Mar 30 15:31:55 AEDT 2011


On 28-Mar-2011, Peter Wang <novalazy at gmail.com> wrote:
> Below is the diff of the HLDS dumps (mmc -dall) at a certain stage.
> Without the conditional, the set.insert call is not being delayed til
> after the set.member check, as would be expected.
> 
> The workaround is to write the construction at the end of the
> predicate instead of in the head.

Another solution is to invoke the compiler with the --unneeded-code option.
If some code computes some values that are needed later on some execution paths
but not on others, this optimization deletes that code from its original
location, and puts copies of it just before the first place on each execution
path that needs one of the values.

It is not enabled by default because it can increase the size of the resulting
code.

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



More information about the users mailing list