Talk:CalmoSoft primes: Difference between revisions

Content added Content deleted
(Note about sequence length)
(→‎Sequence length: Commented.)
Line 37: Line 37:
* If the sequence starts with 3 or more, it must have odd length.
* If the sequence starts with 3 or more, it must have odd length.
--[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 10:04, 10 April 2023 (UTC)
--[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 10:04, 10 April 2023 (UTC)

:It's a good point but, unfortunately, it makes no significant difference to my Wren example (0.1 seconds at most). Whilst it skips the primality test for sequences which have the wrong length, this seems to be counterbalanced by the cost of interpreting the extra code given that for these particular numbers there's not many iterations needed anyway before the longest sequence is found.

:What would make a difference is to speed up the sieving. The C++ entry is using ''primesieve'' which, amongst other tricks, uses all available cores to maximize speed. Unfortunately, Wren is single threaded and so this technique is not available to the CLI version though, in an embedded application, one could write a function to utilize this library from a C/C++ host which Wren could then call. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 13:23, 10 April 2023 (UTC)