Re: Optimizing basic operations

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

When the loop exits list will contain the top 100. shufflelist() simply inserts "this" somewhere in list and drops the last element.

I see. What you're saying is that the time spent doing a shufflelist() plus finding the lowest eval would be faster than a true sort plus lowest_eval = sorted_eval_list[$][1].

Yes. shufflelist() should be faster than sort() but the efficiency of that part of the program is a minor issue since it will be called so infrequently. The overall processing time will be dominated by the trillions of comparisons needed inside the main loop.

The difference between choosing sort() or shufflelist() might mean the difference between a processing time of 10 hours versus 10 hours and 2 seconds. A much bigger concern is the derivation of the data structures in the first place. Tell us about that, there could be some sizeable gains to be had.

regards, Spock

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

Search



Quick Links

User menu

Not signed in.

Misc Menu