Huge lag spikes when connecting nodes in BP editor. How can I fix this? (5.1)

As the title says, every time I connect two nodes, the editor freezes for about 2 seconds. This is extremely annoying since it slows down the entirety of my productivity.
Not only this happens when connecting two nodes, but also when I drag out from a node and then right-click (opens the node list and then close it) and when I click on a node input/output without dragging.

This didn’t happen a month ago; I took a break from Unreal and when I came back yesterday, this was happening.

This happens in small and large blueprints and in both large and small maps loaded.

Does anybody have any suggestions on how to fix this?