When parsing a large article locally on my laptop using Parsoid/PHP integrated with MW via the new REST API, the following parse times were observed:
Environment | Time (s) |
---|---|
Ubuntu packaged PHP 7.2 | 47 |
Compiled PHP 7.2 | 49 |
Compiled PHP 7.2 patched with quadrupled GC_ROOT_BUFFER_MAX_ENTRIES | 28 |
PHP 7.3 | 25 |
PHP 8 (git master) with JIT enabled | 23 |
In PHP 7.2, the GC root buffer is static in size, and collection is triggered when the buffer is full. In PHP 7.3, the GC buffer was made dynamic, with the size automatically tuned at runtime in order to meet a target of 100 objects collected per collection.
I suggest either upgrading to PHP 7.3 in production, or patching PHP 7.2 to have a larger value for GC_ROOT_BUFFER_MAX_ENTRIES.