exec(‘c program that does the parsing’);
Where do I get my prize? ;)
The FAQ states that solutions like FFI are not allowed because the goal is to solve it with PHP :)
What about using the filesystem as an optimized dict implementation?
this is never going to be faster because it requires syscalls
The time you lose at the syscall boundary you may be able to win back during much shorter GC pauses.
Some suggestions that are already in the PR list disable GC.
https://www.php.net/manual/en/function.gc-disable.php