7
votes

I encounter very bad performance when I compile my UWP app with the .Net Native Toolchain enabled.

I profiled the running code (native) and it seems that methods relying on reflection (Unity IoC, Behaviors-SDK, Linq, sqlite-net) are the culprit.

I use the Default.rd.xml so far.

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
   <Application>
     <Assembly Name="*Application*" Dynamic="Required All" />
   </Application>
</Directives>

I have no MissingMetaDataExceptions so far. These only start as I expected when I remove the Application line.

Is there something I'm not seeing here? The app has very good performance without .Net Native. Does it help If I write the Default.rd.xml from scratch working through all MissingMetaDataExceptions which will come?

1
Did you solve it? Since I can see the same behaviour in my app...Jakub Krampl
Having the same experience, the usage of .NET native in UWP store apps has made the development experience for me much worse so far.Johan Falk
No success so far. I removed every trace of Behaviors which helped a little bit but it's still sluggish compared to non-Native.Amenti
@JohanFalk Check this explanationJakub Krampl
@kubakista Thanks for the info. This may very well be the cause. We're using MVVM Light.Amenti

1 Answers

0
votes

The UWP Tools in version 1.3.1 did alleviate the performance impact of MvvmLight.

It was still kind of slow so I switched my IoC-container from Unity to AutoFac. That helped a bit as well but was still not good enough. In the end I had to resort to creating my ViewModels via new again without using the Resolve of the IoC-Container. Now it's very snappy. I did remove all behaviors, this could have helped but I'm not sure about this without implementing them again.