Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

boom!!! Here is a hack solution to make atom start faster. #4293

Closed

Description

@yongkangchen

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

  1. changed the title [-]:boom: Here is a hack solution to make atom start faster.[/-] [+]boom!!! Here is a hack solution to make atom start faster.[/+] on Nov 23, 2014
  2. cherry0199 commented on Nov 24, 2014

    @cherry0199

    Great!
    THANKS A LOT

  3. picibucor commented on Nov 24, 2014

    @picibucor

    It is not working under win. I installed atom with chocolatey.

  4. yongkangchen commented on Nov 24, 2014

    @yongkangchen
    Author

    @picibucor I update the win8 path

  5. yongkangchen commented on Nov 28, 2014

    @yongkangchen
    Author

    Updated, use _this.themes.activatePackages(); replace for specify theme name.

  6. xpol commented on Dec 9, 2014

    @xpol

    Mac (10.10.1) says that my Atom app are broken and suggest me delete it after modified atom.js...

  7. yongkangchen commented on Dec 9, 2014

    @yongkangchen
    Author

    @xpol Apple menu > System Preferences… > Security & Privacy > General tab under the header "Allow applications downloaded from:" try set it to Anywhere?

  8. xpol commented on Dec 9, 2014

    @xpol

    @yongkangchen That woks, thanks.

  9. nijikokun commented on Dec 17, 2014

    @nijikokun

    👍

  10. tomkersnick commented on Dec 24, 2014

    @tomkersnick

    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.

  11. bthusby commented on Dec 30, 2014

    @bthusby

    Will this go into an Atom version soon?

  12. jarig commented on Dec 31, 2014

    @jarig

    Decreased load time significantly for me 👍

  13. bthusby commented on Dec 31, 2014

    @bthusby

    Goody :)

  14. MartinLichtblau commented on Jan 3, 2015

    @MartinLichtblau

    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.

  15. 17 remaining items

  16. seanfuture commented on Jun 19, 2017

    @seanfuture

    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

  17. winstliu commented on Jun 20, 2017

    @winstliu
    Contributor

    Yeah, we're aware - future improvements are detailed at the bottom of the blog post.

  18. mittalyashu commented on Aug 24, 2017

    @mittalyashu

    Why don't developers of the Atom re-develop the software in C++ and Python (just like sublime text) to make it faster?

  19. tommywalkie commented on Sep 18, 2017

    @tommywalkie

    "Why don't developers just re-develop their app in several different languages ? They are so lazy." ( ͡° ͜ʖ ͡°)

  20. ishanray commented on Oct 17, 2017

    @ishanray

    its still slow as of 1.21.1

  21. acrolink commented on Oct 17, 2017

    @acrolink

    Which programming language is used to build Atom?

  22. OwenMelbz commented on Oct 17, 2017

    @OwenMelbz

    @acrolink English

  23. acrolink commented on Oct 18, 2017

    @acrolink

    @OwenMelbz , question edited.

  24. mittalyashu commented on Oct 18, 2017

    @mittalyashu

    It is written in Javascript and CSS.
    image

  25. OwenMelbz commented on Oct 18, 2017

    @OwenMelbz

    Although it’s basically a glorified chrome plugin, so the actual underlying system is most likely in some sort of C derivative

  26. logankratos61 commented on Feb 22, 2018

    @logankratos61

    for windows 10???

  27. BenjaminZekavica commented on May 23, 2018

    @BenjaminZekavica

    Its work for the new version?

  28. lock commented on Nov 19, 2018

    @lock

    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!

  29. locked as resolved and limited conversation to collaborators on Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions