4 ms·
It has to open and read a .js file already, it can certainly turn that into the representative AST for said file and then use the data from that. It will be slo
by Etzos 10y ago
It has to open and read a .js file already, it can certainly turn that into the representative AST for said file and then use the data from that. It will be slower, but it will also be more accurate and less likely to turn up false positives or miss things.
- _RPM 10y agoIt has to parse a javascript file, which isn't trivial. The reason they use regular expression is because implementing a javascript parser isn't an easy problem to solve fast, even though the grammar is available.
- elmigranto 10y agoYou downloading megabytes over network and performing disk IO with it. What's the problem with 100 milliseconds of file parsing?
- Etzos 10y agoOne certainly does not need to implement a parser, just use one of the many available. As the sibling here pointed out the time it would take to parse and walk the AST is negligible compared to the downloads happening.