https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
Web browser: --- Bug ID: 54549 Summary: Not load unnecessary data in token() Product: Pywikibot Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/patches/606/ Reported by: Anonymous user Created on: 2013-04-08 12:22:18 Subject: Not load unnecessary data in token() Assigned to: legoktm Original description: 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
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- patch
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- 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.
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
--- Comment #3 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- 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.
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
--- Comment #4 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **assigned_to**: nobody --> legoktm
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/patches/606
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
Amir Ladsgroup ladsgroup@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Normal CC| |ladsgroup@gmail.com Version|unspecified |core (2.0) Assignee|Pywikipedia-bugs@lists.wiki |legoktm.wikipedia@gmail.com |media.org |
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|legoktm.wikipedia@gmail.com |Pywikipedia-bugs@lists.wiki | |media.org
--- Comment #8 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- I had a patch for this somewhere, but it didn't deal with invaldating the cache properly.
I'm probably just cookie licking this at this point, so unassigning myself.
https://bugzilla.wikimedia.org/show_bug.cgi?id=54549
Sorawee Porncharoenwase nullzero.free@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |nullzero.free@gmail.com Resolution|--- |FIXED
--- Comment #9 from Sorawee Porncharoenwase nullzero.free@gmail.com --- It does not query revisions as it was when I reported this bug anymore, so I would close it.
pywikipedia-bugs@lists.wikimedia.org