Page MenuHomePhabricator

Fix HHVM PCRE cache
Closed, ResolvedPublic

Description

HHVM PCRE cache needs rewriting.

  • m_overflow is just for deallocation -- once the shared cache is full, every call to preg_match() causes another compilation
  • StaticString leakage, even when the shared cache is full. This is apparently a workaround for AtomicHashArray's key limitations "You must use atomically compare-and-swappable integer keys, or a different container class."
  • AtomicHashArray is complex but very limited: no LRU, size limit baked in, "Can grow to a maximum of about 18 times the initial capacity, but performance degrades linearly with growth."
  • Only item count is accounted for, size not accounted for in capacity limit

There's absolutely no chance of rewriting MediaWiki such that it doesn't eventually exhaust the shared regex cache.

Existing HHVM bug report: https://github.com/facebook/hhvm/issues/1182

Done, review pending: https://reviews.facebook.net/D25515

Event Timeline

tstarling claimed this task.
tstarling updated the task description. (Show Details)
tstarling added a project: MediaWiki-Core-Team.
tstarling moved this task to Backlog on the MediaWiki-Core-Team board.
tstarling changed Security from none to None.
tstarling added a subscriber: tstarling.

Needs more development work before it can be accepted upstream

hashar renamed this task from Fix PCRE cache to Fix HHVM PCRE cache.Nov 25 2014, 2:49 PM
hashar added a project: HHVM.

A new patchset has been submitted and has been through two rounds of review, waiting for them now.

bd808 moved this task from Done to Archive on the MediaWiki-Core-Team board.