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

Compilation times are a bit slow #8

Open
ruhler opened this issue Oct 18, 2013 · 3 comments
Open

Compilation times are a bit slow #8

ruhler opened this issue Oct 18, 2013 · 3 comments

Comments

@ruhler
Copy link
Owner

ruhler commented Oct 18, 2013

The Smten compilation times can be a bit slow, especially when compiling things like happy generated grammars. Is there anything we can do to improve these compile times?

@ruhler
Copy link
Owner Author

ruhler commented Oct 18, 2013

If you run smten with '-v', you can see where most of the time is being spent: outputting the generated haskell code for large files.

@ruhler
Copy link
Owner Author

ruhler commented Oct 21, 2013

I switched to using wl-pprint-text for the pretty printer, which seems to speed things up a bit. Now the problem seems to be less pretty printing performance, and more overall size of the generated output.

Some ideas for how to improve things:

  • don't fully qualify every name!
  • do (\a b -> ...), instead of (\a -> (\b -> ...))
  • do (a, b), instead of ((,) a b) for types, patterns, and expressions
  • avoid unnecessary explicit types?
  • do (f x y) instead of ((f x) y)

@ruhler
Copy link
Owner Author

ruhler commented Oct 21, 2013

I tried everything listed above except for avoiding unnecessary types. Using shorter qualified names made the biggest difference: 16s reduced to 14.4s. Now pretty printing is certainly not the bottleneck.

Most time now seems to be spent in:

  • Doing the core translation
  • ghc type checking, simplification, and code generation for the generated code.

I'm not sure how to improve this.

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

No branches or pull requests

1 participant