Last modified: 2008-10-10 22:24:19 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 T17919, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15919 - Parser should cache repeated images on the same page
Parser should cache repeated images on the same page
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/w/index.php?t...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-09 21:26 UTC by Alex Z.
Modified: 2008-10-10 22:24 UTC (History)
1 user (show)

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


Attachments
$mFileCache patch (1.49 KB, patch)
2008-10-09 21:26 UTC, Alex Z.
Details

Description Alex Z. 2008-10-09 21:26:50 UTC
Created attachment 5411 [details]
$mFileCache patch

Currently if a page contains more than one use of the same image, the parser will call wfFindFile() once for each instance of the image regardless of whether or not its loaded it before. On most pages this isn't an issue, but on pages that make heavy use of an image (or images) such as in a template it can significantly slow down loading time to repeatedly reload the same image.

The attached patch adds a file cache for the parser, caching each file object if it gets loaded more than once (to avoid caching every image on the page, suggested by Brion).
Comment 1 Roan Kattouw 2008-10-09 21:30:15 UTC
Why not go ahead and create a global file cache while you're at it?
Comment 2 Brion Vibber 2008-10-09 21:32:01 UTC
A global cache might need additional management for images being created or deleted during a long-running process, and wouldn't have its memory freed when a single-user parser is discarded.
Comment 3 Alex Z. 2008-10-10 22:24:19 UTC
Added in r41952 after some more input from Brion and Tim on IRC (limit size to 1000, resets after reaching 1000).

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


Navigation
Links