[m-rev.] for review: dead_pred_elim optimization

Simon Taylor stayl at cs.mu.OZ.AU
Thu Mar 6 16:17:37 AEDT 2003


On 05-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> Estimated hours taken: 4
> Branches: main
> 
> Fix a performance bug where dead_pred_elim was taking a significant
> amount of time to delete entries from the predicate_table.  With this
> change dead_pred_elim goes from 12 minutes to 55 seconds CPU time in
> the IL grade when compiling accumulator.m with
> --intermodule-optimization turned on.
 
> Index: compiler/hlds_module.m
> ===================================================================
> @@ -1756,22 +1765,45 @@
>  
>  %-----------------------------------------------------------------------------%
>  
> +predicate_table_restrict(OrigPredicateTable, PredIds, PredicateTable) :-
> +	predicate_table_reset(OrigPredicateTable, PredicateTable0),
> +	predicate_table_get_preds(OrigPredicateTable, Preds),
> +	PredicateTable = list__foldl(
> +			(func(PredId, Table0) = Table :-
> +				PredInfo = map__lookup(Preds, PredId),
> +				predicate_table_insert_2(Table0,
> +						yes(PredId), PredInfo,
> +						must_be_qualified,
> +						no, _, Table)
> +				
> +			), PredIds, PredicateTable0).

The `must_be_qualified' here looks wrong.

Surely there is a more space efficient algorithm to build a 234 tree
(other than repeated insertion) when you have a sorted list of entries?

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list