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

Slow to discover tests #52

Open
OliverJAsh opened this issue Aug 21, 2024 · 7 comments
Open

Slow to discover tests #52

OliverJAsh opened this issue Aug 21, 2024 · 7 comments
Labels
question Further information is requested

Comments

@OliverJAsh
Copy link

Hi! Firstly, thank you for this extension. ❤️

I have just enabled this extension for my large work project and I've noticed that it takes quite a long time to discover tests, even when I'm using nodejs-testing.include to narrow the scope to a smaller folder.

Can you recommend a method for me to debug why this is taking so long? Perhaps the extension is running a command to discover test files. Is there a way to see the generated command?

Thanks!

@connor4312
Copy link
Owner

An extension profile would be useful: https://github.com/microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

@OliverJAsh
Copy link
Author

I don't see anything in the profile:

CPU-20240823T110900.217Z.cpuprofile.txt

image

To illustrate my problem, see this screen recording:

Screen.Recording.2024-08-23.at.12.08.07.2.mov

@connor4312
Copy link
Owner

connor4312 commented Aug 23, 2024

Nothing much interesting there. This extension uses the VS Code findFiles and then the file watcher APIs to discover tests, it's possible that is running slow. You might also see the search functionality in VS Code be slow if that's the case.

VS Code implements this by shelling out to ripgrep under the hood, and occasionally software like antivirus and endpoint protection can make that run unusually slow

@OliverJAsh
Copy link
Author

Thanks for the reply.

I'm not seeing slowness anywhere else. I also don't have any antivirus or endpoint protection running on my system.

It could be helpful to log which patterns about being passed into findFiles.

@connor4312
Copy link
Owner

connor4312 commented Aug 23, 2024

Yea, I can also add some logging there if I see it's taking a while. Since I don't see AST parsing taking any time in your profile (the next step after finding files before publishing them to vs code) it's my assumption that that's being slow.

@connor4312
Copy link
Owner

I'm curious if you see any difference with version 1.6.2 which uses the TS Language Features to do the parsing.

@connor4312 connor4312 added the question Further information is requested label Dec 8, 2024
@OliverJAsh
Copy link
Author

Thanks for the update. I just tested it and unfortunately it seems the same. My CPU goes to 100% for about 6/7 seconds due to multiple rg processes.

Let me know if there's anything else I can provide.

It could be helpful to log which patterns about being passed into findFiles.

I still think this would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants