function greatestLessThan pList,V
sort items of pList descending numeric
sort items of pList by each >= V
return item 1 of pList
end greatestLessThan
100,000 items, two sorts, and consistently returns in under 0.075 seconds
on my Mac:
on mouseUp
repeat 100000
put random(10000000),"" after L
end repeat
put the long seconds into T
get greatestLessThan(L,5000000)
put (the long seconds - T) && it into fld 3
end mouseUp
1,000,000 items generally returns in about .95 seconds
10,000,000 items came back in 10.5 seconds, so against my intuition, this
things seems to scale fairly linearly.
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode