Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Conversation

@ssandler
Copy link
Contributor

@ssandler ssandler commented Jan 23, 2023

This yielded a dramatic speedup in HHAST for us, and as far as I can tell is absolutely equivalent.

Since the built-in type of ParserCache is opaque, I had to as dict<_, _> it, and to avoid adding FIXMEs I changed the type annotations where it's used to allow arraykey keys.

The built-in parser doesn't seem to support old style xhp children declarations, but since those have been deprecated for several years I think it's ok to remove support for them in HHAST and the associated migration, so I've done that as well.

@lexidor
Copy link
Contributor

lexidor commented Jan 23, 2023

vec<string> $user_args = vec[],

The $user_args argument is not used. This means there is no need to bypass the cache when not empty anymore.

Alternatively, keep the old implementation around and start this function with if (!C\is_empty($user_args)) return await from_file_hh_parse_async(...); and consider HH\ffp_parse_string() as a fast path.

@ssandler
Copy link
Contributor Author

@lexidor good point! I'm incorporating that and also working on fixing CI.

@ssandler
Copy link
Contributor Author

CI is broken for other reasons, moved the work to get that working into #538

@ssandler ssandler force-pushed the ssandler_ffp_parse_native branch from b478d57 to 1a0273c Compare January 24, 2023 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants