Talk:Self numbers: Difference between revisions

Content added Content deleted
(Using a moving window over a small part)
(→‎Go, tweaked: Responded to Enter your username.)
Line 25: Line 25:


Just saw Horst's idea, haven't incorporated it yet.--[[User:Enter your username|Enter your username]] ([[User talk:Enter your username|talk]]) 19:47, 7 October 2020 (UTC)
Just saw Horst's idea, haven't incorporated it yet.--[[User:Enter your username|Enter your username]] ([[User talk:Enter your username|talk]]) 19:47, 7 October 2020 (UTC)

:Actually, I wondered after I'd done the 'sieve based' version whether using partial sums for each loop would quicken it up but, when it came in so much faster than the 'low memory' version, I didn't bother investigating further.

:Anyway I've now tested it and it does indeed improve performance by around 25% so I've incorporated it into the main page. Have done it slighly different to you (using an array of partial sums) to keep it more 'go fmt' friendly.

:Incidentally, the timings are for my core i7 which is why they're much faster than tio.run's.

:Might do a separate version incorporating Horst.h's ideas as I suspect it might come in a bit slower for the basic task of 100 million numbers while allowing us to stretch that to 1 billion. But we'll see. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 09:06, 8 October 2020 (UTC)