Only validate the RegExp, do not optimize/compile it#4451
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4451 +/- ##
==========================================
+ Coverage 47.24% 51.51% +4.27%
==========================================
Files 476 504 +28
Lines 46892 51369 +4477
==========================================
+ Hits 22154 26464 +4310
- Misses 24738 24905 +167 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Huh, I wonder if we could store that as our AST node, then run the rest of the compilation pipeline at bytecode compilation time (maybe even lazily optimizing/compiling at runtime?) |
|
@jedel1043 We cannot do that specifically. Only internal methods of I tried keeping the Regex object around but it ended up being quite complicated. I have a slightly better understanding of the AST now, so I could try. But this PR could still go in (it doesn't close the issue) as an intermediate step for performance. |
jasonwilliams
left a comment
There was a problem hiding this comment.
LGTM, I agree about the complexity of keeping the result, I looked into it aswell months ago and requires a large refactor in places to pass the value through. We can always merge this now and attempt that at a later date
The
regresspackage does export atry_parsemethod that tries to parse without optimizing and compiling the regex itself.Notes: #4432 does specify that only parsing could improve performance.