In most Game Engines, we would have the luxury of being able to port inefficient Managed Code into faster Native Code if we were hitting performance issues. This is not an option unless we invest serious cash in obtaining the Unity source code, which is offered as a license separate from the Free/Personal/Pro licensing system, and on a per case, per title basis. We could also purchase a license of Unity Pro with the hope of using Native Plugins, but doing so rarely leads to a performance benefit since we must still cross the Native-Managed Bridge to invoke function calls inside of it. Native Plugins are normally used to interface with systems and libraries that are not built specifically for C#. This forces the overwhelming majority of us into a position of needing to make our C# script-level code as performant as possible ourselves.
With this in mind, we should now have enough understanding of Unity Engine internals and memory spaces to detect and...