.Net Core feedbacks

Started 8 Dec 2019
by Bejarid
in Ask the Team
Hi Phoenix Devs!

I see in the last patch that you did the migration to the version 3.1 and I'm curious about your impressions about .Net Core.

DId you jump from .Net 4.X to Core 3.1 or did you migrate to Core 2.X earlier this year? And in any case did you observe performance improvement (CPU, and GC as it is a serious concern here AFAIK)?

Did this migration goes smoothly, or did it took more time than anticipated?

Thanks you for any bits you can share
Sun 8 Dec 2019 11:53 PM by gruenesschaf
Migrating to .net core was basically the first thing we did, the first alpha last year already ran on linux on .net core and since then we have pretty much kept up to date until the launch at which point we were at 2.1 where we stayed as it was an lts release with later on tiered compilation turned on and now with 3.1 also being an lts release we moved on to that.

The unexpected parts were mostly in the asp.net core upgrade which is used in some backend services which among other things forced us to either transform things or use properties on anything we expect model binding to happen as the support for field binding was removed. This had some minor performance impact and hence we opted for some transformation model for anything that was actually used frequently and just accepted properties on rarely used things. As an aside here, while it's common knowledge that auto properties will be inlined and there is no cost whatsoever for using them over fields, they are in practice not always inlined. Spatial queries now take about 40% of our entire load and the position vector was an auto property at some point, changing that to a field reduced the average time for spatial queries by up to 50% which is only possible if something with inlining went wrong which then made us adopt the policy of anything that doesn't have to be a property starting out as a field as none of the actual downsides of fields really apply to us (this is not a library and hence recompiling if we actually need a property is not an issue) and given the spatial query experience properties actually having a negative consequence.

As for the benefits of the migration: none really except lower ram usage with the same settings for some backend services. The major win is primarily in the new apis especially IThreadPoolWorkItem as well as us now being able to use c# 8 features like nullable references or default interface implementations as the gameserver builds what it runs and hence needs the latest sdk to support the latest language features.
Mon 9 Dec 2019 8:19 PM by Bejarid
Thanks for the feedback!

Funny you didn't see much impact as the 3.0 is also said to have big performance improvements on Linux hosted apps.

And are you already using the nullable references in your code? Its lack of support in aspnet libraries kill its reliability and thus its usefulness IMO, through it should change quickly with the 5.0 beta not far away.

Have you tried (or plan to) the new network primitives like Pipelines for your exchange with the DAoC clients, or just using Socket is enough in your case?
This topic is locked and you can't reply.

Return to Ask the Team or the latest topics