Open Goutte opened 2 years ago
I managed to (un)serialize the parse tree, after some tweaking.
There are two issues:
unserialize-callback-func
, but something could perhaps also be done upstream.I can make a MR for the first part, if you're open.
I went ahead and pushed the changes, so I can use my own fork.
Caching is worth it, this script takes about
60ms
without it. You can see theca
(cache) and thevt
(visitor) now eating up all the time
✨ Feature request
Make the parser tree serializable with the
\serialize()
function.Motivation
Making the parser tree takes most of the total computation time. If I could "cache" it somehow, it would be great !
Example
yields
Alternatives
Additional context
The
vt
time is the visitor. The rest could be cached, perhaps. On more complex scripts, with nested flow statements, it goes up to seconds.