Skip to content
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

The compiler is pretty slow. #117

Open
Idorobots opened this issue Apr 10, 2021 · 2 comments
Open

The compiler is pretty slow. #117

Idorobots opened this issue Apr 10, 2021 · 2 comments

Comments

@Idorobots
Copy link
Owner

Idorobots commented Apr 10, 2021

Main culprit: immutable, hash-table based AST causing all sorts of copying to take place.

@Idorobots
Copy link
Owner Author

Observation: The GC plays a big role here as moving some of the performance tests around all of a sudden makes it much more performant.

@Idorobots
Copy link
Owner Author

Idorobots commented May 12, 2021

Things to try out:

  • Avoid using assoc in the optimizer.
  • Move at usages directly to the node constructors.
  • Avoid using generated-related functions in the backend.
  • Rewrite the set implementation to be faster.
  • Rewrite the ast-case to be smarter.
  • Rewrite the AST to use structs & match instead of hashes & ast-case.
  • Rewrite walk-ast not to create so many lambdas.
  • Create custom traverse-ast implementations for each pass, not to have huge pattern matching overhead each time.
  • Store the frequently changing information (free vars, etc) in a separate hash map.
  • Mutate the AST in place instead of copying the entire thing on each change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant