I am using Cache Control builder to cache the results of a method.
The method has the below code and
WebApp webApp = webAppAccess.getWebApp();
String schemaSrc = webApp.getSchema(DEFAULT_SCHEMA_NAME).getSchema().getSchemaSource();
IXml schemaSrcXml = XmlUtil.safeParseXml(schemaSrc);
As you can see I am reading the schema of the model through webApp.
My question is does it in anyway hampers with the overall performance of the project as in
1. How does the webApp.getSchema works does it involve file handling?
2. is it increases some sort of schema or template cache?
3. Or in some other form of load.
Because it is a requirement in all of screens in the project which are around 100 in number.
Is there any other refined approach?
DGawron 10000054HC580 Posts
Re: Performance Related Query?2013-01-31T16:48:50ZThis is the accepted answer. This is the accepted answer.As with all performance questions you can only get a truly reliable answer by measuring the approach under the expected load. That being said, you are going to take a hit with that code. Turning a schema into a string then parsing it into IXml is not a trivial operation. The larger the schema the larger the associated string allocations and GC overhead to clean up all the temp objects. Calling the method may also cause churn in WEF's schema cache.
It's important to consider the size of the schemas, how many times the method(s) will be called, etc. before settling on an approach.
You didn't provide enough detail on why you have to provide access to these schemas or what the method callers will do with the IXml.
aakash_k 270001ETPS58 Posts
Re: Performance Related Query?2013-02-01T04:13:08ZThis is the accepted answer. This is the accepted answer.
- DGawron 10000054HC
I will explain my scenario a bit.
I have a portlet that has two model containers, I need the schema information (very small part of it like 4-5 element information) of model container (MC1) in the other model container (MC2). I need the information inside <AppInfo/> and element's name from the MC1 in MC2. This is where I am making use of that IXml derived out of the schema.
<xsd:element name="SearchabandonedFunds" minOccurs="0" type="xsd:string">
<--- some info here -->
So I am calling the mentioned method which is written in MC1 from the portlet's method and passing it on to the MC2. I have used the cache control builder on the method written in MC1. So I believe this is called only once during the refresh interval of the cache control builder and as per the documentation it is shared application wise.
Generally my schema sizes are below 10 kb and few of them between 20 to 50 kb.
Please let me know if the above information is enough for you to help us give some sort of idea if we are going to hit some performance hurdle.