r46738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46737‎ | r46738 | r46739 >
Date:21:49, 2 February 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r46725, r46726 "Cache cite <references /> output by contents. That way, changes that don't affect Cite references won't cause a re-parsing of Cite, which is a big CPU hog on Wikimedia."
Causes data corruption in output due to misaligned strip markers.
Modified paths:
  • /trunk/extensions/Cite/Cite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite_body.php
@@ -360,28 +360,12 @@
361361 $prefix = wfMsgForContentNoTrans( 'cite_references_prefix' );
362362 $suffix = wfMsgForContentNoTrans( 'cite_references_suffix' );
363363 $content = implode( "\n", $ent );
364 -
365 - // Let's try to cache it.
366 - $parserInput = $prefix . $content . $suffix;
367 - global $wgMemc;
368 - $cacheKey = wfMemcKey( 'citeref', md5($parserInput), $this->mParser->Title()->getArticleID() );
369 -
370 - wfProfileOut( __METHOD__ .'-entries' );
371 -
372 - wfProfileIn( __METHOD__.'-cache-get' );
373 - $ret = $wgMemc->get( $cacheKey );
374 - wfProfileOut( __METHOD__.'-cache-get' );
375364
376 - if ( !$ret ) {
377 - wfProfileIn( __METHOD__ .'-parse' );
378 -
379 - // Live hack: parse() adds two newlines on WM, can't reproduce it locally -ævar
380 - $ret = rtrim( $this->parse( $parserInput ), "\n" );
381 - $wgMemc->set( $cacheKey, $ret, 86400 );
382 -
383 - wfProfileOut( __METHOD__ .'-parse' );
384 - }
385 -
 365+ wfProfileOut( __METHOD__ .'-entries' );
 366+ wfProfileIn( __METHOD__ .'-parse' );
 367+ // Live hack: parse() adds two newlines on WM, can't reproduce it locally -ævar
 368+ $ret = rtrim( $this->parse( $prefix . $content . $suffix ), "\n" );
 369+ wfProfileOut( __METHOD__ .'-parse' );
386370 wfProfileOut( __METHOD__ );
387371
388372 //done, clean up so we can reuse the group

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46725Cache cite <references /> output by contents. That way, changes that don't af...werdna19:29, 2 February 2009
r46726Fix profiling mistake.werdna19:34, 2 February 2009

Status & tagging log