jenkins-bot has submitted this change and it was merged.
Change subject: featured.py: decrease memory usage ......................................................................
featured.py: decrease memory usage
Instead of looping over the list, remove each item when it has been processed. This saves roughly 60% memory (at least on dewiki)
Change-Id: Idb2666d0664cbbddd7dcb011a89dddd3dd7d8948 --- M scripts/featured.py 1 file changed, 3 insertions(+), 2 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/featured.py b/scripts/featured.py index a79770a..28a2630 100644 --- a/scripts/featured.py +++ b/scripts/featured.py @@ -398,7 +398,8 @@ pywikibot.output( '\03{lightred}** %s has %i %s articles\03{default}' % (site, len(articles), task)) - for p in articles: + while articles: + p = articles.pop(0) if p.title() < afterpage: continue
@@ -410,7 +411,7 @@ pywikibot.output(u"(cached) %s -> %s" % (p.title(), cache[p.title()])) continue - yield copy(p) + yield p
def findTranslated(self, page, oursite=None): quiet = self.getOption('quiet')
pywikibot-commits@lists.wikimedia.org