-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RegexAst::Literal instead of const field on strings for fast enums #100
Use RegexAst::Literal instead of const field on strings for fast enums #100
Conversation
@mmoskal kind of messed up the base of this pr as I had to merge main back into yours |
min_length: 0, | ||
max_length: None, | ||
regex: Some(RegexAst::Literal(s)), | ||
} => ®ex_syntax::escape(&serde_json::to_string(s).unwrap()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the bit that makes it a bit tricky to do this for general string regexes -- json quoting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add AST node to escape. Shouldn't be hard.
This takes the compile time of the schema in the linked issue #98 from 162ms to 44ms on my machine (still fairly slow, I suppose). Bundling everything into a lexeme probably really speeds up mask computation too :) |
Closes #84 |
No description provided.