facebookarchive / atom-ide-ui

A collection of user interfaces for Atom IDE.
http://ide.atom.io
Other
934 stars 79 forks source link

Terminal emulator incredible slow to startup #260

Open memeplex opened 6 years ago

memeplex commented 6 years ago

It takes it about 10 seconds to startup. Once it's running it can handle more or less demanding apps like htop without hassle, but startup time is unbearable.

pelmers commented 6 years ago

What OS are you running on? the terminal runs a command (https://github.com/facebook-atom/atom-ide-ui/blob/master/modules/atom-ide-ui/pkg/atom-ide-terminal/lib/pty-service/PtyService.js#L87-L133) to find the default shell before spawning, which might take some time

memeplex commented 6 years ago

I'm testing it with ubuntu 18.04, the default shell should be bash. How can I avoid the shell look up phase so that I can report any improvement related to that?

pelmers commented 6 years ago

If you create a .nuclide-terminal.json config file and set the 'command' field, it should skip the lookup and instead just read the file. see docs at https://nuclide.io/docs/features/terminal/#custom-shell

memeplex commented 6 years ago

Cool, now it launches almost instantaneously, thanks! I wouldn't close this though since > 10 seconds is not a reasonable time to detect the default shell for a platform (I would have expected this to happen in a fraction of a second, wouldn't you?)

memeplex commented 6 years ago

Also, why not adding a setting to the ide options instead of having to add an external file? Is there any technical difficulty with doing that?

pelmers commented 6 years ago

reason that's in an external file is that this terminal is shared with Nuclide, which supports remote editing, where you would want to have the configured shell be specific to the host machine.

pelmers commented 6 years ago

re: slow startup, how long does running getent passwd memeplex take for you? we parse output of that command on Linux to get the correct shell

memeplex commented 6 years ago

Fine. Could I help you finding the bottleneck in the shell checking code? I'm new to atom but an experienced programmer otherwise so I could debug/profile/inspect the code if you guide me a bit.

memeplex commented 6 years ago

In the blink of an eye:

~/proj (master)$ time getent passwd carlos
carlos:x:1000:1000:carlos,,,:/home/carlos:/bin/bash

real    0m0,004s
user    0m0,001s
sys 0m0,003s