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

Fix slow code in hot path #2195

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

anmonteiro
Copy link
Member

fixes #2190

The consolidateSeparator function was recursing on Whitespace
nodes, however preOrderWalk would already do that for us. Therefore,
we were calling this costly function in a hot path many more times than
necessary, effectively making it take exponential time (I think).

fixes reasonml#2190

The `consolidateSeparator` function was recursing on `Whitespace`
nodes, however `preOrderWalk` would already do that for us. Therefore,
we were calling this costly function in a hot path many more times than
necessary, effectively making it take exponential time (I think).
@IwanKaramazow
Copy link
Contributor

👍Good find, approved!

@chenglou chenglou merged commit e120a83 into reasonml:master Sep 21, 2018
@anmonteiro anmonteiro deleted the anmonteiro/fix-slow-code branch September 21, 2018 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refmt] hangs & pegs CPU for a certain ocaml file
4 participants