×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Jon Paris wrote:
>> If this is true, SORTA doesn't really help speed up the search. Is that
correct?
No. But it depends on the specification of the array. If the array has the
keyword ascend or descend on the definition, then %lookup will do a binary
search which is orders of magnitude faster. It is this keyword that
triggers the binary search - not the SORTA.
Ensure that your arrays are in sequence (sorting with sorta, qsort or
whatever) and you will find your lookups work at light speed!
Wellll, it still depends on a lot of varying factors. For example, if
you're only doing one or two lookups on a particular set of data, then
sorting the data will only slow you down, and you may well be better off
with a sequential search.
Any time you're dealing with performance you have to remember one
important thing: When coding for performance, it is vital to test using
proper performance measuring methods. I've personally seen situations
where changes made with the aim of improving performance actually made
matters worse! Tools are important in determining if a performance
improvement in one area of code has negative impacts elsewhere. And on
the subject of sorting and searching, the expected distribution of data
also has an influence on choice of algorithm. Even the lowly Bubble Sort
works very fast when the data is already mostly sorted.
Cheers! Hans
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.