C# Partial Class Awesomeness: will it impact runtime performance?

Hi folks,

I recently discovered the awesomeness of using partial classes when working with Unity and trying to maintain any kind of reusable code base.

As far as I could piece together from various articles on the subject, using partial classes will negatively influence build performance, but should not impact runtime performance at all.

Can anybody with a more sophisticated .NET/Programming background (or a much higher nerd level as me) confirm and explain to me why that is or is not the case?

best,
Andreas

After a quick goole partial simple means a class’s source code can be split into multiple files.

Those don’t exist when it’s compiled - so I’d be shocked if you had any negative performance (compared to same class in one big file).

I’d be surprised if it had any major compilation delay either… seems to be basic text operations to get it back into a single file :slight_smile:

To answer your question, having a partial class will in no way impact performance.