-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Preserve source newlines all the things #37814
Conversation
@typescript-bot perf test this |
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at f2c0bbb. You can monitor the build here. Update: The results are in! |
@DanielRosenwasser Here they are:Comparison Report - master..37814
System
Hosts
Scenarios
|
It's really fascinating to see that this consistently adds up to half a second in compilation times on Node 10/12 for so many of these projects. |
…art or end as its parent
I just merged #37846 into this to see how it does. |
Looks like all the semicolon-related ones are fixed, but I still see a bunch of synthesized statements starting immediately after a |
I’m not sure whether it’s possible to hit that in a refactor, but I could debug the JS emit on one of these and see what the logical error is. I just might not have a test case to add for it. |
Pushed some commits that fix most of the problems at the cost of falling back to the non-source-peeking approach for any construct that fails to set an |
@andrewbranch is this change slated for a particular version, or just an experiment? |
It’s just an experiment, and in fact it’s more @DanielRosenwasser’s than mine, and I’m not sure what his thoughts on this are long-term. We’ve tossed around the idea of exposing this as an opt-in option. For my part, I’m currently pretty leery of that, because aside from the things that look clearly wrong in this diff, there are tons of constructs where we currently don’t check for whitespace, and adding a check to each of those places adds complexity and impacts performance. |
@typescript-bot pack this |
To help with PR housekeeping, I'm going to close this draft PR. It's pretty old. |
An experiment right now to see how the compiler does with preserving source newlines. Right now, the most interesting thing is seeing the bad emit - what is going wrong. The same issues might apply to refactorings/quick fixes, so we should understand what's going wrong and fix that.
Sorta fixes #843.