[m-rev.] diff: improve efficiency of list__merge_sort
Ralph Becket
rbeck at microsoft.com
Tue Aug 28 23:21:38 AEST 2001
> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> Sent: 28 August 2001 14:13
>
> On 24-Aug-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> >
> > library/list.m:
> > Improve efficiency of list__merge_sort by not recomputing
> > the length of the list at each step.
>
> How much difference does this make?
If you're keen to speed up sorting long lists, you'd be best
off going via array__sort/1 which uses in-place SAMsort.
I suspect that the majority of calls to list__sort/1 are for
small lists where it's not worth the bother of changing to
an intermediate representation.
Perhaps after calculating the length of the input for the
first time in list__merge_sort you could make a decision as
to which route to take. That should work out quite nicely.
- Ralph
--------------------------------------------------------------------------
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