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

Bad performance #112

Open
marcinjahn opened this issue Jul 17, 2024 · 2 comments
Open

Bad performance #112

marcinjahn opened this issue Jul 17, 2024 · 2 comments

Comments

@marcinjahn
Copy link

This issue is similar to #93.
I have a solution with hundreds of test files. When I open any test file:

  1. Running "nearest test" doesn't work initially
  2. Opening Test Summary causes major slowdown of neovim. Moving a cursor becomes laggy, my laptop's fans start to spin pretty loud, and lots of dotnet processes get spawned.

image

The middle part is when test discovery got started.

After some time (a minute?) it cools down, and I am able to execute tests.

I have the following config (I'm using LazyVim):

return {
  "nvim-neotest/neotest",
  dependencies = {
    "nvim-neotest/neotest-jest",
    "Issafalcon/neotest-dotnet",
  },
  opts = {
    adapters = {
      ["neotest-jest"] = {
        jestCommand = "npm test --",
        jestConfigFile = "custom.jest.config.ts",
        -- env = { CI = true },
        cwd = function(path)
          return vim.fn.getcwd()
        end,
      },
      ["neotest-dotnet"] = {
        discovery_root = "solution",
      },
    },
  },
}

I'm using solution discovery_root, because I thought it could help. It didn't. I was unsure if it would actuall work, because in my repo I have two sln files in the same directory.

Is there anything I could provide to help with resolution of this issue?

@Issafalcon
Copy link
Owner

Hi @marcinjahn - Seems like you're right, the performance issue has reared it's head again for larger projects.

I believe I'd improved it by using a cache mechanism (see https://github.com/Issafalcon/neotest-dotnet/pull/94/files) to fetch the full test names, but this will need tweaking to ensure the cache isn't cleared as frequently, and probably to ensure a way for users to clear the cache themselves.

On the other hand, when I eventually get time (unlikely for a while though) I was going to look into VS Test and try to get the plugin functioning closer to test discovery and running does in things like visual studio, and rider. But this is a larger undertaking which would consolidate all the test runners.

@Issafalcon
Copy link
Owner

See #90 for the most robust solution to this

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

No branches or pull requests

2 participants