Re: Euphoria's identity/philosophy -- Where is the focus?

new topic     » goto parent     » topic index » view thread      » older message » newer message
Spock said...

Eg, a fundamental process underpinning just about any non-trivial business task is the sorting of lists of data. The sort has to be stable and capable of sorting by column. Performance is also another consideration. The std sort routines just dont' cut it. The code is also bloated and ugly. Whoever created std\sort.e hasn't done a good job at all:

sort() - NOT stable

custom_sort() - NOT stable

sort_columns() - NOT stable, in fact, worthless for business apps or anything where the correctness of the end data is paramount.

insertion_sort - STABLE but has bad performance for large data sets, also no column sorting

I've written my own sorting routines. There is one interface, sort(), and a few extra optional params to get whatever specialisation I require (column, index, custom, arbitrary). The sort is always stable, capable of column sorting, and very fast.


The std/sort.e routines date back to at least E2.5 which have always used the shell sort algorithm.

A stable sort is "one which retains the original order of items while sorting." That is when two items of equal value are sorted the do not change relative positions if the sort is stable but may or may not change if the sort is unstable.

The old docs tell you a shell sort is unstable but do not define "stable."

The cure for a better sort algorithm is if you, Spock, could contribute the code you have developed and already tested to the standard library. We would all be grateful.

Spock said...

Another example: The Hash Table in map.e - Although this probably has correctness, it is extremely bloated and has terrible performance. I would consider this implementation to be the HT equivalent of BubbleSort. Of course I've written my own with a much simpler interface and much better performance.

The same goes for alternative Hash algorithms and interface.


new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu