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

formatting is slow (~1 minute) for large (~5000 elements) lists #753

Open
avh4 opened this issue Dec 6, 2021 · 2 comments
Open

formatting is slow (~1 minute) for large (~5000 elements) lists #753

avh4 opened this issue Dec 6, 2021 · 2 comments
Labels
help wanted performance upgraded-parser Issues that are best solved after upgrading to the elm-compiler-0.19 parser

Comments

@avh4
Copy link
Owner

avh4 commented Dec 6, 2021

While greatly improved by #642, something is still slow for large lists. Two Elm Slack users have noted that files with ~5000 element literal lists can take more than a minute to format.

@avh4
Copy link
Owner Author

avh4 commented Dec 6, 2021

help wanted note: At this point, and help starting to debug the problem would be helpful. Here are some possible ideas that might lead to useful information:

  • record formatting times for files with lists of different lengths: does time increase linearly, quadratically, etc?
  • run with profiling enabled: is the slow part in parsing or in formatting? where are the hotspots? (I'd guess most likely there is backtracking happening as a result of how comments are being parsed which is maybe the root of the issue, but it would be good to get this confirmed)
  • does memory use increase along with run time?

@avh4
Copy link
Owner Author

avh4 commented Nov 21, 2022

Something else interesting to check would be to try the equivalent source file with gren format on gren-lang/compiler@439e38f since it uses the Elm 0.19 parser -- if that deals with it better, then continuing the conversion of elm-format to the new parser might be the most efficient way to improve this.

@avh4 avh4 added the upgraded-parser Issues that are best solved after upgrading to the elm-compiler-0.19 parser label Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted performance upgraded-parser Issues that are best solved after upgrading to the elm-compiler-0.19 parser
Projects
None yet
Development

No branches or pull requests

1 participant