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

Performance Issues With Undo/Backspace - Freezing/Crashing #183

Closed
vaughnroyko opened this issue Mar 11, 2015 · 12 comments
Closed

Performance Issues With Undo/Backspace - Freezing/Crashing #183

vaughnroyko opened this issue Mar 11, 2015 · 12 comments

Comments

@vaughnroyko
Copy link

On a fresh, clean install with Atom Typescript (with Linter/Autocomplete+) installed, the following issues occur on a larger .ts file (around 3000+ lines, although the more lines you have, the bigger the issue - there is some stuttering even on 500 line files):

Holding down backspace over any code in file will cause the linter to execute (or maybe it's just the TypeScript error checking?), seemingly every character removed, freezing Atom completely during being held down and up to 1 minute after backspace is let go. This effect can sometimes even lock up Atom completely, never recovering. It also appears that the autocomplete dialog seems to be firing as well during this, as if you get it to stop in the right place, it will open up (only sometimes). Undoing a large amount of operations will also illustrate this issue, especially over lots of small changes.

This isn't directly related, but could solve the issue I am describing. Changing any option in the Linter/Autocomplete+ settings will have no effect on Atom Typescript. Not sure if this is by design, but being able to control the linter and autocomplete settings would solve the issues I am describing since I could disable linting/error-checking on change, or use a execution timeout, or limit the results in autocomplete, or the letters needed to autocomplete. Type the letter "i" and watch the tens of thousands of results it gives on a medium-sized project.

Showing the effects of the performance issue:
http://screencast.com/t/iBywbX2KF2w5

I start by editing a smaller file with no issues, then move to a bigger one. As you can see it's taking full chunks out of my code with backspace, freezing and stuttering as it goes. During undo, it locks up for a couple seconds at a time.

Any workaround is appreciated. Thanks!

@basarat basarat self-assigned this Mar 11, 2015
@basarat
Copy link
Member

basarat commented Mar 11, 2015

Can you try the 1.5 branch

cd %HOMEPATH%.atom\packages
git clone https://github.com/TypeStrong/atom-typescript.git
git checkout typescript-1.5

It has fixes that don't post the entire text file to the worker all the time : #179

@vaughnroyko
Copy link
Author

Unfortunately still having the same issue.

@basarat
Copy link
Member

basarat commented Mar 11, 2015

@vaughnroyko Thanks for testing. Sorry that it didn't fix it. Can you share the repo?

Also tip: you can paste images from clipboard directly in the github comment window. No need to use screencast.

@vaughnroyko
Copy link
Author

@basarat Unfortunately it's a private repo at the moment. But I can reproduce it with a single file, completely unlinked from anything else. Here's such a file: http://vaughnroyko.com/stuff/items.ts

The screencast was a video. I could not find a way to attach the video directly - let me know if this is not the case.

@basarat
Copy link
Member

basarat commented Mar 11, 2015

I could not find a way to attach the video directly - let me know if this is not the case.

ah. That explains why I couldn't open it on my phone. Just use https://screentogif.codeplex.com/

@basarat
Copy link
Member

basarat commented Mar 11, 2015

Your video is most excellent 👍 . Investigating.

@basarat basarat added the bug label Mar 12, 2015
@basarat
Copy link
Member

basarat commented Mar 12, 2015

A bigger issue is that editing the end of this large file will reliable (every time) : https://github.com/TypeStrong/atom-typescript-examples/blob/master/bigfile/bigfile.ts crash the new edit change detection.

@vaughnroyko
Copy link
Author

I'm glad my giant definition file can serve as an example, hah. Thanks for looking into this!

@basarat
Copy link
Member

basarat commented Mar 12, 2015

Fixed : c78a0f1#commitcomment-10157972

Sorry about that. Still investigating LS version getting out of sync from reality. But that isn't causing this performance bug.

@basarat basarat closed this as completed Mar 12, 2015
basarat added a commit that referenced this issue Mar 12, 2015
@basarat
Copy link
Member

basarat commented Mar 12, 2015

Still investigating LS version getting out of sync from reality.

fixed 8fd3610#diff-ed09a6b54d1678ad915acb85684ad75fR160 I am sad.

@basarat
Copy link
Member

basarat commented Mar 13, 2015

@vaughnroyko This should be fixed. Here is a demo on your bigfile:
bigfile

@vaughnroyko
Copy link
Author

I experienced the same performance as you did, doing what you were doing. And even backspacing over ObjectTypes in the lootGroups, it was all good (first thing done in the .gif below). But, when tried the same thing on strings, and then some more complex item objects, the same stuttering and freezing occurred, although I want to say it's not as bad as it was before, but not 100% sure on that:

ts-backspace-performance

Also, I didn't show it in the .gif, but undoing (ctrl+z) those same actions that I did locked up Atom for nearly 10 seconds in some cases. Which, in the end is the bigger issue, since I don't normally backspace like shown in the .gif.

@basarat basarat reopened this Mar 13, 2015
@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
angelestelar5z added a commit to angelestelar5z/atom-typescript that referenced this issue Aug 17, 2024
…ifferent view.

* Don't call `getText` in the middle of a did change. closes TypeStrong/atom-typescript#183 Totally my fault
* utility method to debug LS view of a file
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants