CAB Performance Issue

Topics: CAB & Smart Client Software Factory, Jobs & Opportunities, Mobile Client Software Factory, Offline Application Block, Updater Application Block
Jun 18, 2007 at 2:35 PM
Hi,
my team implemented win application, using framework 2.0 and CAB. We followed all the rules from CAB documentation and used BankTeller sample as CAB reference implementation. We did not considered slow performances of our application during developement, but now when we are preparing release we want to improve application response time. The main problem is that application needs about 18 seconds to start(it inclueds shell + 9 modules loading, with 52 views and 20 services ). We tested all our custom code and did not find any time consuming code.
Do you have any experiences or ideas where the problem may be?

If I have noticed well BankTeller sample CAB application needs about 2 seconds to start, even though it has only 2 modules and 10 views and it is fairly simple.
Is it expected that my application has so poor performances because of its size and CAB performances?

Thanks,
Indigo Cowboy
Jun 18, 2007 at 4:33 PM
How did you test the code? Which profiler did you use? Do you access network resources during startup (web services, databases etc.) ?
We have fewer modules than your project, but about the same amount of services and our app loads in about 4-6 seconds. Loading just the shell with no modules or services takes about 3-4 seconds so we have minimum load time impact for our modules. We do cache and lazy load resources that are vital to the system, so the very first time it will take longer, but that's only once per user.
Sep 21, 2007 at 2:48 AM
All the reflection needed for CAB might have an impact on you app.
We have been trying to fix the CABGen and OBGen from Mobile CAB and Mobile OB, I'm sure it wont work on the desktop but it might only need a few changes on the defined policies. You might want to check it out.
Sep 21, 2007 at 8:10 AM
Edited Sep 21, 2007 at 8:22 AM
If I have noticed well BankTeller sample CAB application needs about 2 seconds to start, even though it has only 2 modules and 10 views and it is fairly simple.
I'll have to repeat rcsDev's question and ask how did you test?
If you are running in Visual Studio in debug mode, your test is completely invalid - something I won't go into here.

My experience is that I don't really notice a performance hit from CAB...yet. I have 2 very large modules I'm loading now which include over 300 C# source code files (that's just the modules, and doesn't include the DomainModel and Persistence assemblies which would put the number of source files at over 500).
Now, at the command line, on a precompiled .exe (built using Nant) to load 2 modules from start to go (including a custom splash screen we implemented which overrides ModuleInit events) takes 5-6 seconds - that includes NHibernate initialisation of over 100 mapped xml files. On a Pentium dual core with 2GB. With NHibernate's initialisation, I'm guessing that CAB is not really 'adding' any time over what it would take to load assemblies of the size I'm loading. I'm also using DevExpress 3rd party components - dlls which, all up, are about 15MB.

Dec 23, 2008 at 9:06 PM
PandaWood you might like to profile the BankTeller app with ANTS Profiler, the EventBroker mechanism is pretty expensive and so it is loading any workitem...
Jun 9, 2010 at 4:43 AM

@PandaWood

Can you give me an idea on how you integrated Nhibernate with your CAB project? I'm currently migration my project to CAB/SCSF and I already have a BLL/DAL/DAO layer using Nhibernate but have no idea how to integrate it.

Thank you.