Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms with Prism and DryIoc with a lot of registered page, can reduce performance?

For example, we have a big Xamarin forms project, with 2000 page, and Prism MVVM framework, with DryIoc container, that has registered all 2000 pages.

This a lot of pages, added with DependencyService for example, navigationservice, dialogservice, can reduce navigation's speed and/or performance? It can makes app run slow, for a lot of dependency?

Thanks!!

like image 830
Giuseppe Novielli Avatar asked Dec 22 '25 02:12

Giuseppe Novielli


1 Answers

There isn't a simple answer to this. The general one is - yes. The DryIoc, like any package, is an additional overhead to your project. The IoC container surely adds some time to the overall feeling. Keep in mind that the overhead is minimal - in the matter of some milliseconds. Like it says in the GitHub repo:

Designed for low-ceremony use, performance, and extensibility.

DryIoc is considered to be a relatively fast container. Here is the official IoC Container Benchmark - Performance comparison.

But again, it all depends on how many services you need to instantiate. It doesn't matter if you have 2000 pages. It matters how many dependencies you will have with these pages and how many circular dependencies also.

Also, some of the IoC logic is being done on app start-up and you can also match some of the resolving there.

To sum up - it is better to have IoC container, than to not have one because the flexibility, that you get from it, beats the eventual small overhead of performance.

like image 182
Mihail Duchev Avatar answered Dec 24 '25 17:12

Mihail Duchev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!