Patches item #3610302, was opened at 2013-04-08 05:22 Message generated for change (Comment added) made by legoktm You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3610302...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: rewrite Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody)
Assigned to: Legoktm (legoktm)
Summary: Not load unnecessary data in token()
Initial Comment: In token(), It queries info and *all* revisions of a page. Querying all revisions is too expensive and unnecessary. For example, if I just want to process the last revision of several pages and put them back, with the old code, it loads all revisions when putting. It makes putting in rewrite branch spend time about 10x compared to that in the trunk.
The patch I am presenting just do not load revisions. It shouldn't break other functions since needed data has included in the info of a page.
---- Pywikibot branches/rewrite/ (r11357, 2013/04/07, 14:50:30, ok) Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] unicode test: ok
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2013-04-08 05:59
Message: Committed in r11359, thanks.
I do agree that token() does need a re-think, it probably should be using a straight query rather than a generator, we also should be caching tokens per login session. Gonna leave this open for now so it can be properly fixed.
----------------------------------------------------------------------
Comment By: Nullzer0 (nu11zer0) Date: 2013-04-08 05:28
Message: I forgot to login again, sorry.
Anyway, I think that token() should be rewrited. Its function should be restrict to just obtain the token. If we want lastrevid or other informations, it should place somewhere else. This will make token not bind to a page.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3610302...
pywikipedia-bugs@lists.wikimedia.org