Unity Editor runs smoothly on its own, but becomes VERY laggy when using visual scripting

What versions of macOS are you on? I ask because we know there are performance issues with the Unity Editor on macOS Ventura (see Performance Issues in Unity Editor on Ventura (2021.3.10f1) ).

If it is that issue, the latest version of 2021.3 has a fix in already, other Editor releases should be following with the fix shortly.