4 ms·
Unity games are often reported to have performance issues, allegedly due to the underlying GC (or lack of understanding of it). I'd rather hope for the adoption
by emsy 10y ago
Unity games are often reported to have performance issues, allegedly due to the underlying GC (or lack of understanding of it). I'd rather hope for the adoption of a less messy C++ alternative that is suitable for quasi-realtime applications. So far Jai seems to be the most serious competitor in this regard.
- pjmlp 10y agoBecause Unity uses a Jurassic Mono implementation with a stone age GC and JIT implementation. By the same metrics, we should evaluate performance of C and C++ code by using benchmarks with MS-DOS C and C++ compilers, which should be about the same age. Don't mix languages with implementation when talking about performance.
- socialist_coder 10y agoAmen brother. I think most perf problems in Unity games would go away if Unity updated their GC. It's definitely our #1 source of frame rate hiccups. Plus, it makes you write weird crappy code just to avoid GC allocations. Ugg =(
- Yuioup 10y agoAre there plans to replace Mono with .NET Core?
- pjmlp 10y agoNo, Unity guys are doing their own thing with IL2CPP. Basically they generate C++ from MSIL as a means to generate native code, instead of building their own compiler backend. They plan however, to eventually update their Mono runtime. https://forum.unity3d.com/threads/future-plans-for-the-mono-runtime-upgrade.464327/ https://forum.unity3d.com/threads/future-plans-for-the-mono-...
- stcredzero 10y agoUnity games are often reported to have performance issues, allegedly due to the underlying GC (or lack of understanding of it). Is there a way of running C# with reference counting?
- flukus 10y agoAt that point you've created a different language with different semantics.
- stcredzero 10y agoI think "you can write C#, but you can only have your references form a DAG" would be acceptable in a lot of contexts, like game programming. (Existing libraries would still require some form of tracing, but I think there are ways that the tracing could be handled by another thread.)
- theprotocol 10y agoI instinctively get that thought whenever I work with C#. It's really nice but would it kill them to at least offer simplistic memory management semantics?
- pjmlp 10y agoPeople think RC as GC algorithm is simpler, but it isn't. Naive implementations are slower than tracing GC, while high performance ones are as complex as tracing GC ones, while having the burden of forcing the developers to explicitly deal with cycles.
- stcredzero 10y agohigh performance ones are as complex as tracing GC ones, while having the burden of forcing the developers to explicitly deal with cycles. I bet there are plenty of game developers who would be only too glad to arrange their references as a DAG, if they could have guaranteed low latency.
- AlexeyBrin 10y ago> So far Jai seems to be the most serious competitor in this regard. 1. Jai is not even released. 2. Jai is a programming language, not a game engine. Unity is slow because they are using an outdated C# implementation (some old Mono).
- emsy 10y ago1. If you follow its development you know the features and the design philosophy. What's your point? 2. I picked Unity because it's the most popular engine with an underlying GC. Regardless of their GC implementation, in games you don't want opaque runtime behaviour, which a GC always introduces. This leads to weird workarounds in your code that nobody understands instead of having clear and explicit memory management.
- AlexeyBrin 10y agoMy point is that until a language is proven, as in used on a large scale it is just a nice idea. Let's wait until Jai is released and used by different teams for different tasks until we proclaim its superiority.
- emsy 10y agoI didn't claim superiority, I just that it's the most serious competitor. A point I still stand by. The original post compared the adoption of C# to the adoption of C++, the now de-facto standard for games. C# does not have what it takes to become the de-facto standard for games.
- pjmlp 10y agoSure it does. C++ became a de-facto standard for games, because console SDKs moved from C to C++, pushed by the companies selling them. The same companies that are now adopting Unity and have already toyed with the idea of having a C# SDK. If for the sake of example, PS5 SDK would be C# based, devs that wanted any money from PS5 games would adopt it, regardless of their feelings regarding C++ vs C#.
- adamrezich 10y agoNot to be too pedantic but I'm pretty sure he's never actually referred to it as "Jai" and everyone's only been inferring that because of the source file extensions.