CabGen and ObGen

Topics: Mobile Client Software Factory
Jun 18, 2006 at 9:15 AM
originally posted by: m_a_madero

Is there any document indication how to use it?
Jul 2, 2006 at 9:11 PM
originally posted by: dcazzulino

Sorry for the delay.
There's no documentation yet, but there will be in RTM.
There's not much to say, fortunately ;). You just run both tools on your shell and module assemblies, by passing the assembly file path to the tool as the first command line argument. That will generate "assembly.cabgen.dll" and "assembly.obgen.dll". You just need to deploy these alongside your exe/dlls and you should inmediately see the performance improvement.

/kzu
Jul 3, 2006 at 6:20 AM
originally posted by: m_a_madero

Thanks for the info..
Aug 19, 2006 at 12:55 AM
originally posted by: RobertoRocco

Is there at least any information yet about what CabGen and ObjGen are doing internally? I mean: How do they improve performance? Just re-stting the DLL base addreses?
Aug 19, 2006 at 3:06 AM
originally posted by: dcazzulino

Nah... there's no black magic in those tools ;)
By default, the tools will leave a .cs file alongside the generated assembly that contains the source emitted for it. You can inspect that to see how everything works.
Basically the ObGen tool generates a class implementing IPolicyProvider, which is probed by name. If it exists, it is used to retrieve the policies that apply to the object being built, instead of reflecting on the attributes of the type at run-time. Saving reflection is only one part, though. The other is that by avoiding reflection, we can also pass policies that implement strong-typed policy behavior, such as a custom creation policy that will do new MyObject() instead of Activator.CreateInstance.

The combined reflection + strong-typing proved to be a huge perf. boost on the device.

BTW, you can always look at the tools sourcecode too ;)
Sep 10, 2007 at 1:09 PM
Edited Sep 10, 2007 at 1:34 PM
Sorry, ignore this post... i missed the processors folder that has the processors in! DOH!

Matt




Hi

We have been looking at CaB and OB for use in our project, specifically we are looking at the Mobile Client Software Factory. We are doing some investigation work on how all these things work and fit together and to look at potential performance gains we would see using OBGen and CaBGen.

I have been looking at CaBGen itself and have found that it basically iterates through all the types in the assembly that is passed to it and iterates each property and method of each type and calls ProcessMethod or ProcessProperty respectively. However in the code that I have these two methods are empty.

What i'd like to know is if this is correct and that we should put code in these methods to optimise cab, or is the code actually missing? If it is correct, can someone tell me what sort of stuff I should be putting in here?

Also would I be right in thinking that the majority of the optimisation would be in OBGen (if these methods are supposed to be empty)?

I have installed the july 06 release of MCSF that is up for download on MSDN.

Thanks

Matt
Sep 21, 2007 at 5:17 AM
Yes matt, you are right.

W have found that Obgen has some problems handling delegate types, generics and some naming issues with CommandHandlers and have corrected a few of this bugs.

We might post somewhere a new version or at least the steps to correct that manually.

Please let us know what do you think of this tools.
Sep 24, 2007 at 9:07 AM
We have built a couple of test applications with the MCSF and have run obgen and cabgen against them to assess the performance impact. We have seen a marked improvement in performance when using obgen against our test applications. I'll definitely let you know how we get on with building our prototypes.

The main problems we have had have been with initial setup of obgen and cabgen, some of which have been posted and answered on this forum, which has helped a lot. Getting the object builder assemblies mixed up between obgen and the actual application, and the initial install and having to hunt around for microsoft.cci.dll before the installer will work were the main issues.

Thanks

Matt



mamadero wrote:
Yes matt, you are right.

W have found that Obgen has some problems handling delegate types, generics and some naming issues with CommandHandlers and have corrected a few of this bugs.

We might post somewhere a new version or at least the steps to correct that manually.

Please let us know what do you think of this tools.

Oct 5, 2007 at 1:21 AM
There should be an action in the guidance packge that activates obgen and cabgen for the selected modules and it will just run a post build command the builds both assemblies. This will greatly help in deployment. We have this configured on a couple of our projects depending on the build configuration but still needs a lot of manual work, it should be just as easy as right clicking it.

Anyway, please let me know how are the protoypes going.
Dec 5, 2008 at 5:53 AM
Is there any CabGen Obgen code available that can work with Objectbuilder2 and SCSF 2008? or if there is any CabGen , ObGen version that is tested to work for any version of SCSF then please post the link for the same.