question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only create AST once per file

See original GitHub issue

Today 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:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
mrjoelkempcommented, Aug 16, 2016

I just cut a new minor release (v5.5.0) with these changes. 🎊

1reaction
mrjoelkempcommented, Aug 13, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found