Skip to content
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

When opening vscode Maven Projects take about 11 seconds to appear #77

Closed
joshunger opened this issue Jul 12, 2018 · 7 comments
Closed
Assignees
Labels
feature-request New feature or request
Milestone

Comments

@joshunger
Copy link

joshunger commented Jul 12, 2018

Describe the bug
When opening vscode Maven Projects take about 11 seconds to appear.

To Reproduce

  • Root directory has 16 directories.
  • 8 subdirectories have pom.xml files.
  1. Restart vscode.
  2. Expand Maven Projects.
  3. Start timer until projects appear.

Expected behavior
Would a second or two be acceptable?

Environments (please complete the following information as much as possible):

  • OS: OS X
  • VS Code version: Version 1.26.0-insider (1.26.0-insider)
  • Extension version vscjava.vscode-maven-0.9.2

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@Eskibear
Copy link
Member

The extension recursively searches for pom.xml except for folders with certain patterns specified in maven.projects.excludedFolders. Do you have folders with large amount of files in your projects? If yes, you can exclude them.

There's also a setting entry maven.projects.maxDepthOfPom, by default it's -1 meaning infinite, you may use that to speed up. E.g. for pom file located in rootDir/subDir1/pom.xml, the depth should be set at least to 3.

BTW, does the issue only occurs after you upgrade it to v0.9.2?

@Eskibear Eskibear self-assigned this Jul 13, 2018
@Eskibear Eskibear added the needs more info Further information is requested label Jul 13, 2018
@joshunger
Copy link
Author

BTW, does the issue only occurs after you upgrade it to v0.9.2?

I don't know.

If I got these commands correct, all files -

➜  find . -type f | wc -l
  257431

Trying to exclude node_modules -

➜ find . -type f -not -path "*node_modules*" | wc -l 
   33991

@Eskibear
Copy link
Member

In your case I suggest that you exclude more files by adding items into the maven.projects.excludedFolders for the moment. Or change the value of maven.projects.maxDepthOfPom to a positive integer.

  // Specifies filepath pattern of folders to exclude while searching for maven projects.
  "maven.projects.excludedFolders": [
    "**/.*",
    "**/node_modules",
    "**/target",
    "**/bin"
  ],

I'll evaluate and investigate the performance.

@Eskibear
Copy link
Member

@joshunger I'm refactoring part of the code, I find vscode.workspace.findFiles API should be much faster then simple traversal. And thus maven.projects.maxDepthOfPom would be no longer needed. FYI

@Eskibear Eskibear added this to the 1.0.0 milestone Jul 17, 2018
@Eskibear Eskibear added feature-request New feature or request and removed needs more info Further information is requested labels Jul 17, 2018
@Eskibear Eskibear mentioned this issue Jul 17, 2018
8 tasks
@joshunger
Copy link
Author

@Eskibear Awesome, thank you!

@Eskibear
Copy link
Member

Fixed in commit a7e54a8

I've test in my working directory with a bunch of projects. Using VS Code's API, it takes 1600-1800ms to search pom.xml files now. (Showing nodes in the explore actually takes extra time, about 1 seconds in my experiment.)

$ find . -type f -not -path "*node_modules*" | wc -l
23170

It will be shipped in v1.0.0, you can checkout the latest code if you want to try it now.

@Eskibear
Copy link
Member

released in v0.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants