Last modified: 2014-10-29 06:12:36 UTC
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
patch
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.
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.
- **assigned_to**: nobody --> legoktm
Ping
(In reply to Ricordisamoa from comment #5) > Ping Ping to who? Ping about what? Just writing "ping" normally isn't very helpful.
(In reply to Andre Klapper from comment #6) > Ping to who? Ping about what? > Just writing "ping" normally isn't very helpful. Ping Legoktm: this bug has been assigned to him for over 3 months...
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.
It does not query revisions as it was when I reported this bug anymore, so I would close it.