Skip to content
Notifications
Clear all

How do I isolate if a slowdown is from Claw or from my language server?

3 Posts
3 Users
0 Reactions
1 Views
(@jakeb)
Reputable Member
Joined: 1 week ago
Posts: 160
Topic starter   [#5557]

Hi everyone, new here and hoping to get some guidance. I've been using Neovim on macOS with a growing list of plugins, and I've started to notice some pretty significant slowdowns, especially when opening larger codebases. The thing is, I'm not sure where to point the finger.

My main suspects are **Claw** (the fuzzy finder) and **clangd** (my C++ language server). Sometimes when I trigger Claw, there's a noticeable lag before the popup appears. Other times, general navigation feels sluggish even when I'm not using Claw, which makes me wonder about the language server.

I'm trying to be methodical about this, but I'm not sure the best way to test. I've thought about disabling one or the other temporarily, but I'm worried that might not give me the full picture since they could interact in weird ways? Also, I'm not super confident with profiling tools yet.

Here's my current setup:
- **Editor:** Neovim 0.9.5
- **OS:** macOS Sonoma 14.4
- **Key Plugins:** Claw, nvim-lspconfig (for clangd), nvim-cmp, nvim-treesitter, telescope (for other things), and a few others for syntax and git.

What's a good, step-by-step way to figure out which one is the culprit (or if it's the combination)? Should I be looking at startup time, or is there a way to measure performance during a specific action like a file search? Any beginner-friendly profiling tips would be super appreciated! 😅



   
Quote
(@ci_cd_plumber_99)
Estimable Member
Joined: 4 months ago
Posts: 112
 

You're right to be methodical, but you're overcomplicating the "full picture" worry. Isolating components is how you get a baseline. Start with the biggest offender: disable Claw entirely (comment it out of your config) and restart Neovim. Open a large project. Does general navigation still feel sluggish? If yes, your primary suspect shifts to clangd or treesitter. If the lag disappears, you've nailed it down to Claw or its interaction with your filesystem.

For clangd, the simplest test is to temporarily stop the language server. With nvim-lspconfig, you can use `:LspStop` on a buffer. See if responsiveness improves during normal editing and navigation. If it does, your clangd is likely bogged down by your project's compile_commands.json or indexing.

Realistically, on a large C++ codebase, it's often both. Claw might be scanning more files than it needs to, and clangd might be using too much memory, making everything else slower. Profile them separately first.


Speed up your build


   
ReplyQuote
(@ethanp)
Estimable Member
Joined: 1 week ago
Posts: 86
 

You're on the right track wanting a systematic approach. The worry about interactions is understandable, but starting with isolation is still the correct first step. Think of it as binary search: you need to know which half of the system the problem is in before you can diagnose subtler interactions.

A practical first step beyond simply disabling plugins is to use Neovim's built-in profiling. You can run `:profile start profile.log`, then `:profile func *` and `:profile file *` before performing the slow action, like triggering Claw. After a few seconds, run `:profile pause` and examine the log file. It will show you exactly which functions are consuming the most time. This can directly point to Claw's internals or clangd's callback handlers, removing the guesswork.

For the language server, remember clangd's performance is often tied to your project's compile flags and the presence of a `compile_commands.json`. If that file is missing or incorrect, clangd will work much harder. That sluggishness during general navigation, even without Claw, is a strong indicator the language server is struggling with indexing. Try `:LspInfo` to see its status and check its logs for repeated indexing messages.


Let's keep it constructive


   
ReplyQuote