Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2008 Server
>>>Huh? for just finding the minimum, stepping once through the store is the fastest option, differences come from implementation details like language. And as the time to sort big arrays increases more than the stepping approach, unless afterwards an operation on sorted items is needed, asort() feels like a bad idea unless used for a particular spot, but not as a common way to resolve the question.
>>
>>Implementation detail: ASORT is C code. A do while loop is Fox higher level pseudo compiled code. Wouldn't asort be fastest until the list had thousands of entries? Just curious
>>
>But the rule says not to code to the implementation ;-)
>
>Benchmarking such stuff is not easy if you want to to get more than a snapshot - there might be edge cases like nearly ordered lists or nearly descending ordered lists and so on. And there is nothing stopping you from implementing arrmin/arrmax functions in C - you still have to load the array elements from vfp memory before comparing, so my guess is the speed difference there is nowhere near the 5 to 20 times speedup usually found if going into C memory space as well. Otherwise such functions probably would have been in foxtools for some time now ;-)
I think when they say don't code to the implementation, they mean code to the interface. I'll choose to say that Fox is the interface to C. ;)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement