My Grasshopper canvas gets slow when using C# script

Yes.

Even a very small file can create hundreds or thousands of geometry bits that will bring any computer to its knees, depending on what it’s trying to do.