Skip to content

[IDE] Slow Startup - Create Examples menus for Libraries (need ignore files) #10235

Open
@ricardojlrufino

Description

@ricardojlrufino

Hi, I realized that also the code that builds the examples of the libraries, may have a problem. If the library has large documentation (docs) like generated by doxygen, or some other directory with many files, the IDE will take a long time to scan.

My first idea was to ignore the known files ... as is done with .svn and .git ... but I ended up identifying that it is better to do this treatment below:

private boolean addSketchesSubmenu(JMenu menu, UserLibrary lib) {
return addSketchesSubmenu(menu, lib.getName(), lib.getInstalledFolder());
}

to this:
To only focus on the folder of interest.

private boolean addSketchesSubmenu(JMenu menu, UserLibrary lib) {
    File examples = new File(lib.getInstalledFolder(), "examples");
    
    JMenu submenu = new JMenu(lib.getName());
    boolean found = addSketches(submenu, examples);
    if (found) {
      menu.add(submenu);
      MenuScroller.setScrollerFor(submenu);
    }
    
    return found;
  }

In my case I had a node_modules folder (don't ask me why ... lol) it took about 5s to read it
total time was around 11s, because i had another library with a big docs folder.

PS: Sorry for opening several separate problems, but it is for us to track the errors I found. As it is part of an ongoing refactoring, in order to solve part of the same "slow startup" problem, it is difficult to make several separate pull requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: IDEThe Arduino IDEfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions