Short overview of the costs you are paying by using extremely safe single-threaded Unity API (which is basically every call to the engine, including properties like Transform.localPosition) and how to avoid paying them.
Spoiler: these costs are huge.