Skip to content

Default to in-memory OPcache on PHP 8.1-8.4 (about 2x faster journeys than OPcache off) #2581

Open

Description

@chubes4

What happened

#2574 turned OPcache off by default, because php-wasm's default mode, file-cache-only, is slower than compiling every script. That change only measured the file cache.

In-memory OPcache (opcache.file_cache_only = 0) is a lot faster. On the Extra Chill network rig (27 plugins, 11-site multisite, PHP 8.4), Extra-Chill/extrachill#483 set it through pluginRuntime.php.bootstrapIniEntries. Journey step times, against 14 baseline runs with OPcache off:

Journey OPcache off (median) In-memory OPcache
musician onboarding ~5m00s 2m39s, 2m15s
show-ratings ~56s 24s, 20s
anonymous submission ~16s 8s, 8s

A probe at the end of the run reported OPcache enabled: 7,964 hits, 4,390 misses, 0 out-of-memory or hash restarts, 125 MB used.

Target state

  • With no recipe override, the bootstrap php.ini turns on in-memory OPcache for PHP 8.1–8.4: opcache.enable=1, enable_cli=1, file_cache_only=0, memory_consumption=256, interned_strings_buffer=16, max_accelerated_files=20000, revalidate_freq=0.
  • PHP 7.4, 8.0 and 8.5 keep OPcache off. Enable in-memory OPcache for PHP 8.1+ to reduce warm request latency WordPress/wordpress-playground#3617 found in-memory OPcache crashes 7.4/8.0 and misbehaves on 8.5.
  • Recipe bootstrapIniEntries still override the default.
  • Extend tests/playground-cli-runner-bootstrap-ini.test.ts with the version matrix.

Once this ships, Extra-Chill/extrachill can drop its rig-side override.

🤖 Filed by Extra Chill Bot (Claude) on Chris's behalf.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions