Repository navigation
boom!!! Here is a hack solution to make atom start faster. #4293
Description
LastUpdate:
Good news with atom v0.199.0: Opening editors is now significantly faster than previously releases
After discuss in why-is-atom-so-slow, I pull a request Better user experience for start atom: #4269.
Today, I do a deep review the atom source code, and find a hack solution to make atom start faster:
this is the final modify screen video demo:
https://drive.google.com/file/d/0B8i7zRr2bfCAV0NoeG50dURMaW8/view?usp=sharing
What It Is
It delay the config file load, and the packages load and active, which cost much time on start.
After change, atom only load and active the must packages on start, which is ui theme、syntax theme、tabs、status-bar、tree-view.
Then delay to load and active other package. Window and mainly package will show quickly.
How To Do:
1、open atom.js
for mac: /Applications/Atom.app/Contents/Resources/app/src/atom.js
for win8:
C:\ProgramData\chocolatey\lib\Atom.{replace to atom version}\tools\Atom\resources\app\src\atom.js
2、replace the below function Atom.prototype.startEditorWindow
3、you can test and change the setTimeout time to adapt your computer.
4、notice that you should modify atom.js again after you update the atom.
Atom.prototype.startEditorWindow = function() {
var CommandInstaller, dimensions, maximize, resourcePath, safeMode, _ref;
_ref = this.getLoadSettings(), resourcePath = _ref.resourcePath, safeMode = _ref.safeMode;
CommandInstaller = require('./command-installer');
CommandInstaller.installAtomCommand(resourcePath, false, function(error) {
if (error != null) {
return console.warn(error.message);
}
});
CommandInstaller.installApmCommand(resourcePath, false, function(error) {
if (error != null) {
return console.warn(error.message);
}
});
dimensions = this.restoreWindowDimensions();
// this.loadConfig();
this.themes.loadBaseStylesheets();
this.keymaps.loadBundledKeymaps();
setImmediate((function(_this) {
return function() {
_this.themes.activatePackages();
_this.packages.activatePackage("tabs");
_this.packages.activatePackage("status-bar");
_this.packages.activatePackage("tree-view");
_this.loadConfig();
setTimeout(function(){
_this.packages.loadPackages();
_this.packages.activate();
if (!safeMode) {
_this.requireUserInitScript();
}
_this.subscribe(_this.config.onDidChange('core.autoHideMenuBar', (function(_this) {
return function(_arg) {
var newValue;
newValue = _arg.newValue;
return _this.setAutoHideMenuBar(newValue);
};
})(_this)));
if (_this.config.get('core.autoHideMenuBar')) {
_this.setAutoHideMenuBar(true);
}
}, 300); //NOTE: here can change
};
})(this));
// this.packages.loadPackages();
this.deserializeEditorWindow();
this.watchProjectPath();
// this.packages.activate();
this.keymaps.loadUserKeymap();
// if (!safeMode) {
// this.requireUserInitScript();
// }
this.menu.update();
// this.subscribe(this.config.onDidChange('core.autoHideMenuBar', (function(_this) {
// return function(_arg) {
// var newValue;
// newValue = _arg.newValue;
// return _this.setAutoHideMenuBar(newValue);
// };
// })(this)));
// if (this.config.get('core.autoHideMenuBar')) {
// this.setAutoHideMenuBar(true);
// }
maximize = (dimensions != null ? dimensions.maximized : void 0) && process.platform !== 'darwin';
return this.displayWindow({
maximize: maximize
});
};
Activity
[-]:boom: Here is a hack solution to make atom start faster.[/-][+]boom!!! Here is a hack solution to make atom start faster.[/+]cherry0199 commentedon Nov 24, 2014
Great!
THANKS A LOT
picibucor commentedon Nov 24, 2014
It is not working under win. I installed atom with chocolatey.
yongkangchen commentedon Nov 24, 2014
@picibucor I update the win8 path
yongkangchen commentedon Nov 28, 2014
Updated, use
_this.themes.activatePackages();replace for specify theme name.yongkangchen commentedon Nov 28, 2014
Also add a gist about the hack code: https://gist.github.com/yongkangchen/86f0284291584d0b7c78
xpol commentedon Dec 9, 2014
Mac (10.10.1) says that my Atom app are broken and suggest me delete it after modified atom.js...
yongkangchen commentedon Dec 9, 2014
@xpol
Apple menu > System Preferences… > Security & Privacy > General tab under the header "Allow applications downloaded from:"try set it to Anywhere?xpol commentedon Dec 9, 2014
@yongkangchen That woks, thanks.
nijikokun commentedon Dec 17, 2014
👍
tomkersnick commentedon Dec 24, 2014
Thanks for posting this. Extremely helpful.
This decreased the package loading by 200ms. I'm using Yosemite release 10.10.1 mbp retina 2.5GHz quad-core Intel Core i7.
bthusby commentedon Dec 30, 2014
Will this go into an Atom version soon?
jarig commentedon Dec 31, 2014
Decreased load time significantly for me 👍
bthusby commentedon Dec 31, 2014
Goody :)
MartinLichtblau commentedon Jan 3, 2015
Thx!
But why is Atom loading the whole recursive file structure if I click only on one file, that's a big waste of performance.
17 remaining items
winstliu commentedon May 15, 2017
@csvan Atom 1.17.0, currently in beta, improves startup performance by around 50%.
http://blog.atom.io/2017/04/18/improving-startup-time.html
seanfuture commentedon Jun 19, 2017
That's nice @50Wliu - However it's still very slow relatively speaking ( not going to name competition ) as of 1.18.0. So please keep up the work on improving the start time - Thank you
winstliu commentedon Jun 20, 2017
Yeah, we're aware - future improvements are detailed at the bottom of the blog post.
mittalyashu commentedon Aug 24, 2017
Why don't developers of the Atom re-develop the software in C++ and Python (just like sublime text) to make it faster?
tommywalkie commentedon Sep 18, 2017
"Why don't developers just re-develop their app in several different languages ? They are so lazy." ( ͡° ͜ʖ ͡°)
ishanray commentedon Oct 17, 2017
its still slow as of 1.21.1
acrolink commentedon Oct 17, 2017
Which programming language is used to build Atom?
OwenMelbz commentedon Oct 17, 2017
@acrolink English
acrolink commentedon Oct 18, 2017
@OwenMelbz , question edited.
mittalyashu commentedon Oct 18, 2017
It is written in Javascript and CSS.

OwenMelbz commentedon Oct 18, 2017
Although it’s basically a glorified chrome plugin, so the actual underlying system is most likely in some sort of C derivative
logankratos61 commentedon Feb 22, 2018
for windows 10???
BenjaminZekavica commentedon May 23, 2018
Its work for the new version?
lock commentedon Nov 19, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!