3 ms·
My main problem with LINQ is that it seems to perform terribly on mobile. I was looking for map/reduce/etc type functions for C# in Unity, and thought I found i
by tolmasky 13y ago
My main problem with LINQ is that it seems to perform terribly on mobile. I was looking for map/reduce/etc type functions for C# in Unity, and thought I found it with LINQ. To my dismay, LINQ creates so many crazy intermediate objects to pull off its "laziness" that our GC high water mark was being crossed all the time. I went and just reimplemented everything from underscore.js in C# and got way better performance. I imagine this is probably not an issue on desktops/servers.
- Locke1689 13y agoIf you'd like to share your code, I'm a functional programmer at heart and am always looking for optimization opportunities for functional-style programming in C#. If you send me some of the code you were having trouble with I can see if your use case maps well into some compiler optimization strategies.
- gecko 13y agoIt's not mobile; it's old versions of Mono having a completely shit GC. Do you know whether Unity has upgraded to SGEN yet?
- tolmasky 13y agoI don't believe so, I know we had to use the same pool workarounds that everyone seems to need due to this issue