Extremely bad performance in .Net Native compiled UWP app
Asked Answered
S

1

7

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?

Schematism answered 29/1, 2016 at 16:24 Comment(5)
Did you solve it? Since I can see the same behaviour in my app...Garlicky
Having the same experience, the usage of .NET native in UWP store apps has made the development experience for me much worse so far.Et
No success so far. I removed every trace of Behaviors which helped a little bit but it's still sluggish compared to non-Native.Schematism
@JohanFalk Check this explanationGarlicky
@kubakista Thanks for the info. This may very well be the cause. We're using MVVM Light.Schematism
S
0

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.

Schematism answered 13/4, 2016 at 7:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.