Only create AST once per file
See original GitHub issueToday the same file content is read in both precinct
at https://github.com/mrjoelkemp/node-dependency-tree/blob/master/index.js#L104 and cabinet
at https://github.com/mrjoelkemp/node-dependency-tree/blob/master/index.js#L134.
So one AST is create for getting the dependencies and one for getting the type when resolving the file.
If we could find a good way to only read file content and create the AST once per file we should probably see a huge performance boost.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
perform AstGen on whole files at once (AST->ZIR) #8516
This proposal takes that design strategy, and observes that it is possible to generate ZIR for an entire file indiscriminately, for all Decls, ......
Read more >ast — Abstract Syntax Trees — Python 3.11.1 documentation
AST . An abstract syntax tree can be compiled into a Python code object ... is abstract: only instances of specific constructor nodes...
Read more >Introduction to Abstract Syntax Trees - Twilio
AST stands for Abstract Syntax Tree and they power a lot of parts of ... establishes a rule that you can only have...
Read more >How to create AST with ANTLR4? - Stack Overflow
I have created a small Java project that allows you to test your ANTLR grammar instantly by compiling the lexer and parser generated...
Read more >FAQ How do I create and examine an AST? - Eclipsepedia
An AST is created by using an instance of ASTParser, created using the newParser factory method. You will typically create an AST for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just cut a new minor release (v5.5.0) with these changes. 🎊
I made the fixes to filing-cabinet to support an
ast
option. There’s a new v1.4.0 minor release.The only changes left are within dependency-tree: to pipe the precinct ast into filing-cabinet and bump cabinet to use the new 1.4.0 release.