-
Notifications
You must be signed in to change notification settings - Fork 203
Editing is very slow - about one second per keystroke #446
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
Comments
Hello there! The major culprits here would be the syntax highlighting and the TypeScript compiler running in the background to provide information about your code. Did this not happen in previous versions? As you may have noticed there was a big rewrite of the grammar used for syntax highlighting with the 5.0 release, it's probably more complex than the previous one by an order of magnitude, so a slightly bigger strain on the CPU is to be expected, however since a rule is only ever applied to a single line, performance shouldn't differ much between smaller and larger files. I can notice no significant difference between this file and any other TypScript file in terms of performance, neither in terms of perceived performance, nor what is reported by the CPU profiler. I tried this on an instance running on Windows and one running on OS X. I don't have a Linux machine at hand to test, but I can't really imagine that being the issue. Maybe you could post some screencaps with the profiler in them? Preferably both for this file and another TypeScript file that doesn't experience this issue? Regards, |
Hi Cu3PO42! Hopefully this is more legible than a screen shot. I figured out how to run the profiler (I'm new to Atom). I did some typing (mostly just editing comments) and noticed about a quarter of a second (subjective - don't know how to measure it) of lag each time I typed a key this time. Here are the top few lines of the profile sorted in descending order on the "Self" column, which I assume is like the Exclusive Hits in Visual Studio profiler. I stopped on the row that fell below 1%.
Here are the results sorting descending by "Total" (Inclusive Hits?). Again, I stopped when the number fell below 1%.
Does this help? |
Is anyone looking into this? I'm still finding Atom unusable for working on TypeScript... :( It's too slow. I type a few characters, then I have to wait for it to catch up with me. I'm switching back to WebStorm 10 for now. It's a shame because Atom is very nice in many other ways, but responsiveness is a critical requirement for an IDE. Is there anything further I can do to help diagnose or fix this issue? |
I've been trying to figure this out. However I don't get the same issue, also my time is extremely limited right now. The order of CPU consuming tasks is roughly the same for me, however it's a lot faster and more responsive overall. Since I can't reproduce this properly, I don't really know where the problem lies either. I doubt your PC is just too slow to handle Atom, since WebStorm seems to work fine. I'll get back to you once I do manage to figure this out. Sorry this isn't working properly for you right now. |
Thank you, Cu3PO42! I will take a whack at it over the weekend, even though I have never worked on Atom code before. Will update here if I discover anything interesting. |
Can't reproduce it either.
My screen grab: Thanks 🌹 |
Hi basarat, I completely uninstalled Atom, deleted my ~/.atom folder, reinstalled Atom 1.0.2, and re-adjusted all my settings the way I like. Now everything is very fast! I don't know what got screwed up, but it is working fine now. Thanks for taking a look, and I'm sorry for the distraction...
|
Never an issue. Thanks for your patience. BTW nice book : http://cosinekitty.com/raytrace/contents.html respect 🙇 |
It's also unbearably slow for me. In a project with about 10 .ts files it takes more than 5 minutes from when I make a key stroke until I get the first signs of intellisense! This is on a very fast PC. I tried uninstalling atom and configurations and reinstalling to no avail. 😞 Also when there is a warning or error message, it disappears so fast that I can never read it. I only see a yellow or red pop up coming and going. |
@omidkrad can you share your tsconfig + directory tree showing tsconfig.json and node_modules (if any) |
This is my tsconfig.json {
"compilerOptions": {
"module": "amd",
"target": "ES5",
"noImplicitAny": true,
"noEmitOnError": false,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
} node_modules is really large. It contains 587 folders. Maybe that's why it's so slow? Now I remember I might have used |
@omidkrad alternatively move |
Now I feel I'm in a 🚀!! 👍 |
I should probably add #332 to the faq https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md |
For what it's worth it's rocket fast for me @basarat! 🌷 |
(My tsconfigs are all in subdirectories) |
this is craaazy slow for me too... a very simple static project with a single going back to sublime for now |
It is much faster after I excluded the tmp and dist directories in tsconfig.json |
Hey all, I am facing the same issue... typing (0.5 secs per keystroke) and autocompletion (~ 5 secs) are really slow. I am using the following angular project: https://github.com/mgechev/angular2-seed I already did the following things:
Another information: other files work just fine, just *.ts are that slow. Are you guys using the latest version of Atom (i.e. 1.6)? Maybe you guys can help me. Let me know if I can provide something useful that helps digging into this issue. Cheers, |
I had the same issue when trying TypeScript, I have only one Excluding packages(node_modules, etc.) worked for me as suggested by @jcmoore0. |
hmmm.. I did that as well, changed nothing. |
Same for an Angular-CLI based project. In Sublime, we don't wait for the autocomplete panel to appear. |
+1 It would be nice to figure out where the bottlenecks are occurring as this issue is grinding my workflow to a halt. |
Excluding node_modules resolves the slowness, but on the other hand we loose the @types from things like module.id and describe, beforeEach, etc in a Angular 2 project. Sublime and vscode works with node_modules without being slow. |
@asfernandes Thanks, just leaving a note for anyone who might stumble across this as it can be a real source of frustration. I fixed the issue by being very thorough when settings the You may still lose some of the functionality as mentioned by @asfernandes above, however this is certainly a compromise I'm willing to make to eliminate the unbearably slow processing. |
@stewhouston and others, it became usable for me with this:
|
I was using atom as well for typescript and it was painstakingly slow. I would add I'm using Ubuntu 16.04 LTS, a 2nd gen i5 and 8GB RAM. Adding I've honestly given up and don't even feel it would be worth the time to solve, so that I could use Atom instead of VS Code. So far, for typescript anyway, microsoft's editor has been a much better experience. |
I have all of a sudden seen Atom slow to a crawl on Windows 10. I just installed Norton thought maybe that was it, but I turned off everything in Norton and its still slower than a dog pooping. |
Please try the beta from this PR - #1166. It should be much faster. |
I have found that with larger projects atom-typescript is far, far too slow to use... |
UPDATE - After I wrote the report below, editing suddenly became faster. It's still a little slow, but much better. I don't know what changed or how to make it happen again. :(UPDATE 2 - 2015-07-17: I'm still finding Atom unusable for working on TypeScript... :( It's too slow. I type a few characters, then I have to wait for it to catch up with me. I'm switching back to WebStorm 10 for now. It's a shame because Atom is very nice in many other ways, but responsiveness is a critical requirement for an IDE.
Using atom-typescript 5.0.17 and Linter 1.2.0 or 1.2.3, I am now in a state where editing a particular TypeScript file is very slow. Every key I press takes about a full second for the editor to respond. There is no perceptible lag editing files other than this particular file, including C++ files, HTML, and even other TypeScript files.
Not sure it matters, but I'm running Debian Jessie after an upgrade from Debian Wheezy:
The following may help repro the problem:
src/flywheel.ts
If I can provide more info to diagnose/repro this problem, please let me know!
Thanks in advance...
Don
The text was updated successfully, but these errors were encountered: