Maybe it's laggy because apps in Unity are written in c# instead of c+?
We're not talking about Python here, C# is a JIT compiled language not an interpreted one. The performance could be roughly comparable given the same code.
I think they actually just released a new version that supports a more newer runtime but I doubt KSP upgraded.