Hi!
Exporting a static php array (
php.net/var_export
<http://php.net/var_export>) into a .php file will be our best bet for
performance. HHVM has an optimization that takes advantage of the copy
on write semantics. It will create a single read only instance in
memory shared between all execution threads as long as the array is
completely static (after constant folding and such). This basically
means there will be no parsing/loading it just exists in memory ready to
use.
I didn't test on HHVM but I did test on PHP, and in PHP, if you need a
static data array, PHP file plus opcode cache is the fastest way I could
find to get it. I imagine it holds for HHVM too, maybe even more so. So
if we're porting it to PHP it'd make sense to make LM files PHP arrays.
--
Stas Malyshev
smalyshev(a)wikimedia.org