3 ms·
I would have thought the problem with using C# for a game wouldn’t be so much the execution speed (which should be pretty close to native) than the freezes requ
by cm2187 7y ago
I would have thought the problem with using C# for a game wouldn’t be so much the execution speed (which should be pretty close to native) than the freezes required for garbage collection.
- Rapzid 7y agoYou just don't create garbage. Object pools and stack variables.
- romanovcode 7y agoUnity is C# and there are many games which are fast. If you don't want GC to slow you down - just don't add garbage.
- alkonaut 7y agoYes, that's one of the problems. So you want to have zero garbage collection. That means you want zero garbage creation. That in turn means not allocating on the heap in the game loop, and that's rather easy to avoid doing explicitly (just don't use "new" for class types, for example!, use pooling and structs). But C# makes it tricky because a lot of the BCL types allocate under the hood. Some times even the compiler inserts allocatoins from syntax sugar (parameter arrays for varargs). These are pitfalls that the Burst subset tries to solve.