TF2 sudden FPS stuttering after 15-20 minutes in-game.

I'm not sure what is causing this, but running the native build of TF2 directly through Steam, the only unusual things being using gamemode and mastercomfig (https://comfig.app, a common performance config for TF2), and the game runs seemingly perfectly up until about 15-20 minutes of gameplay where I seem to have very sudden and fleeting FPS drops, and as far as I can tell it is coinciding with whenever i give any mouse input. For prosperity the mouse is a Logitech G402. My system is in performance mode, is plugged into mains power (important seeing as it's a laptop), and doesn't have this issue with any other game from what I can see.

My mouse is still at 125Hz (I know it's a gaming mouse but generally I haven't seen high polling rates have any significant benefit for me, so I thought it was best to free up my CPU from being bombarded by interrupts).
Solution
Update: this was caused by a broken ollama installation pinning my CPU.
Was this page helpful?