Talk:Mian-Chowla sequence: Difference between revisions

→‎Basic Algorithm: Perhaps one of the procedural Python compressions costs more than it saves ?
(→‎Basic Algorithm: replies to replies)
(→‎Basic Algorithm: Perhaps one of the procedural Python compressions costs more than it saves ?)
 
Line 38:
:Thanks for pointing out that the 2nd Go version contains some redundant code - probably a hangover from an earlier version I wrote. Anyway, I've removed it now and achieved the ~40% performance boost you mentioned :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 09:32, 21 March 2019 (UTC)
:: You're welcome. --[[User:Enter your username|Enter your username]] ([[User talk:Enter your username|talk]]) 13:38, 21 March 2019 (UTC)
Tidying and simplifying the functional Python, it occurred to me that one of the speed optimisations in your procedural version could possibly be losing more on the swings than it's gaining on the roundabouts. Most of the integers tested will not turn out to be Mian-Chowlas, so perhaps the cost of constructing a new set, saving all sums from the test, and then (in most cases) just clearing that set, is an uncertain investment ? (The current functional draft doesn't bother, and still seems fast). Of course, both versions are now at a few dozen milliseconds, so nothing much turns on it :-) [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 15:40, 4 April 2019 (UTC)
9,655

edits