Historical forum-msg-id-135001-edit, Revision 1

Original date:2020-06-26 10:33:46 Edited by: petelomax Subject: Re: Phix:Sort Columns Not Working Like Expected

Spock said...

I downloaded the latest version of Phix to examine the sort routines. It appears that sort_columns() is a wrapper for custom_sort() which uses Shellsort which is acknowledged in the source as being unstable.

For Orac I dumped RDS' Shellsort in favor of a Merge/Insertion sort hybrid (See Timsort) to guarantee stability. Without stability it is risky to do multi-column sorting as the result might not always be 100% correct. For the business programs used in our office correctness is absolutely essential.

Given the popularity of Phix I recommend the same or equivalent be done to it. The above hybrid is reasonably performant.

Spock

I think the best thing we've got so far in trems of stables sorts is pihism_sort(): https://openeuphoria.org/forum/131271.wc#131305 (also part of demo/rosetta/CompareSortingAlgorithms.exw)

I'm open to offers, but not about to embark on anything regarding stable sorting by myself.

Pete

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu