button "Array (original)" Found 664579 primes in 51.543966 seconds button "Array (bwm)" Found 664579 primes in 49.139622 seconds button "Array (mark)" Found 664579 primes in 43.483821 seconds button "Byte (alex)" Found 664579 primes in 15.016109 seconds button "Byte (bwm)" Found 664579 primes in 11.357213 seconds button "Byte (bernd)" Found 664579 primes in 7.874756 seconds
I've uploaded a stack with each version of the function. The last has some comments added as well. Mark's version is pretty close to the original, but did not return an ordered list (which is an implicit requirement). I added a sort so the times are comparable. https://milby.us/lc/Primes.livecode To Mark's point about C... the person that originally devised the test was using it to baseline and compare several scripting languages relative to optimized C++ code. For LCS, we had to do a bit of work to overcome the way arrays are stored internally (hash map). Yes, LCS is still much slower in this test than everything else listed. I didn't try any on my seat, so the times are not really directly comparable, but Python/Perl both did one run in about 2.5s on average. This kind of makes me want to translate this into LCB to do a comparison. There we do have a real list type that could be used and compared against the other methods employed here. Thanks, Brian _______________________________________________ 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
