Last modified: 2014-06-30 15:27:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68539, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66539 - Keep getEntity in cache for all modules and wikidata-templates in a page
Keep getEntity in cache for all modules and wikidata-templates in a page
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
WikidataClient (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-12 18:09 UTC by Rical
Modified: 2014-06-30 15:27 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Rical 2014-06-12 18:09:16 UTC
When the same module, calling once getEntity(), is used N times in the same page, the profiler shows a multiplied time for total getEntity(). This time could be reduced by caching "getEntity()" for all modules and wikidata-templates in a page. This time is also the far largest in the total time.
Comment 1 Brad Jorsch 2014-06-12 18:55:40 UTC
getEntity is provided by one of the Wikidata extensions, not by Scribunto itself, so reassigning there.

Be careful not to introduce a new bug to be tracked by bug 65258 when implementing this cache.
Comment 2 Daniel Kinzler 2014-06-30 14:27:44 UTC
As far as I am aware, getEntity should be handled via an CachingEntity(Revision)Lookup, which does caching (two layers, actually: in-process and memcached). That's how it's supposed to work, anyway. Is there evidence that this is not the case?
Comment 3 Daniel Kinzler 2014-06-30 14:29:29 UTC
On a second thought: the Lua version of getEntity needs to convert the entity to a Lua object (or meta-table or whatever). I don't know how fast or slow that is. Perhaps we could also cache the Lua version of the Entity. Can we cache objects between Lua invocations in a sane way?
Comment 4 Marius Hoch 2014-06-30 14:32:50 UTC
(In reply to Daniel Kinzler from comment #3)
> On a second thought: the Lua version of getEntity needs to convert the
> entity to a Lua object (or meta-table or whatever). I don't know how fast or
> slow that is. Perhaps we could also cache the Lua version of the Entity. Can
> we cache objects between Lua invocations in a sane way?

We do in memory caching in Lua as far as I remember, but there's no way we can store data there longer.

Most of the times when Lua requests an entity it actually only needs a label. I already talked to Aude about this: We should have a cached label lookup for Lua, the parser functions and the changes list stuff in order to load labels without having to load the full entities.
Comment 5 Daniel Kinzler 2014-06-30 15:27:26 UTC
@Marius: we have a caching TermIndex service. The interface isn't pretty, but perhaps it could be polished for use in Lua.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links