You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by "Raj U. Shaikh" <Ra...@mastek.com> on 2013/07/22 18:22:06 UTC

Performance issue's

Hi,
I am facing performance issue with application which plays with xml's

Problem is:

1.       There are too many heavy xml embedded in flex modules swf.

2.       After load of these module we start parsing that xml's in to VO's. (Value Object a simple as3 object)

3.       We use these VO's at different part of application as and when necessary.
While, Profiling application using 'flash builder profiler' I encountered that step 2(parsing xml's and converting it to Vo's) is taking more time and responsible for many loitering of xml objects.

Solution is:

1.       I want a utility which will generate a swf which will have as3 VO's converted from xml's.

2.       Application will load that swf file and start using that VO's directly.
That means I wanted a readymade VO's so that my parsing time will be reduced.

Implementation?
So how can I embed as3 objects instead of xml's into swf/modules?
Or
How can I convert xml's into as3 VO's at compile time? (I am ready with compile time overhead than runtime)

Clue is:
In BlazeDS, We can convert Java objects into as3 objects.
So similarly can we convert xml's into as3 or xml's into java objects then into as3 objects?



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com<http://www.mastek.com/>

||yatha dristi, tatha sristi||

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Performance issue's

Posted by João Fernandes <jo...@gmail.com>.
If your VOs are static you can always try to serialize them to disk in AMF
format and embed them using  mimeType="application/octet-stream" similar to
what is described here[1]. This way you could easily deserialize those
objects without the conversion penalty. To easily update those files, you
could use any AMF enabled application to generate them, like BlazeDS,
AmfPHP, ColdFusion, FluorineFX, etc and then embed them at compile time.
I'm not sure but I think it would also be possible to load them at runtime
but didn't try it.


1)
http://archive.darronschall.com/weblog/2009/09/using-servicecapture-to-capture-data-for-mock-service-creation.html




On 22 July 2013 17:22, Raj U. Shaikh <Ra...@mastek.com> wrote:

> Hi,
> I am facing performance issue with application which plays with xml's
>
> Problem is:
>
> 1.       There are too many heavy xml embedded in flex modules swf.
>
> 2.       After load of these module we start parsing that xml's in to
> VO's. (Value Object a simple as3 object)
>
> 3.       We use these VO's at different part of application as and when
> necessary.
> While, Profiling application using 'flash builder profiler' I encountered
> that step 2(parsing xml's and converting it to Vo's) is taking more time
> and responsible for many loitering of xml objects.
>
> Solution is:
>
> 1.       I want a utility which will generate a swf which will have as3
> VO's converted from xml's.
>
> 2.       Application will load that swf file and start using that VO's
> directly.
> That means I wanted a readymade VO's so that my parsing time will be
> reduced.
>
> Implementation?
> So how can I embed as3 objects instead of xml's into swf/modules?
> Or
> How can I convert xml's into as3 VO's at compile time? (I am ready with
> compile time overhead than runtime)
>
> Clue is:
> In BlazeDS, We can convert Java objects into as3 objects.
> So similarly can we convert xml's into as3 or xml's into java objects then
> into as3 objects?
>
>
>
> Thanks & Regards,
> Raj Shaikh
> Senior Software Engineer
>
> Majesco Mastek - P&C Division
> Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off
> Thane Belapur Road, Mahape Navi Mumbai - 400701
>  (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332
> | www.mastek.com<http://www.mastek.com/>
>
> ||yatha dristi, tatha sristi||
>
> MASTEK LTD.
> In the US, we're called MAJESCOMASTEK
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Opinions expressed in this e-mail are those of the individual and not that
> of Mastek Limited, unless specifically indicated to that effect. Mastek
> Limited does not accept any responsibility or liability for it. This e-mail
> and attachments (if any) transmitted with it are confidential and/or
> privileged and solely for the use of the intended person or entity to which
> it is addressed. Any review, re-transmission, dissemination or other use of
> or taking of any action in reliance upon this information by persons or
> entities other than the intended recipient is prohibited. This e-mail and
> its attachments have been scanned for the presence of computer viruses. It
> is the responsibility of the recipient to run the virus check on e-mails
> and attachments before opening them. If you have received this e-mail in
> error, kindly delete this e-mail from desktop and server.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>



-- 

João Fernandes

RE: Performance issue's

Posted by "Raj U. Shaikh" <Ra...@mastek.com>.
Hi Manish,
Please find steps I did to gain performance,

Extracting information from XML and converting it into VO is done in AIR application,
Code in AIR project:

function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void
			{
				//XML information data. Demo xml is provided actual xml has thousands of line code.
				var objectModelXML:XML = new XML(<Policy>
													<policyNumber>POL123</policyNumber>
													<policyName>RAJ</policyName>
													<amount>Billion</amount>
													<Attribute>
																		<Name>R1</Name>		
																		<Fame>R2</Fame>
													</Attribute>
												</Policy>);
				//registerClassAlias("ObjectModel", ObjectModel); //registering vo class ObjectModel in AIR app
				var object:ObjectModel = convertXMLToObject(objectModelXML);
				var ba:ByteArray = new ByteArray();
				ba.writeObject(object);
				trace(writeBinaryFile("om", ba));
			} 
			
			private function convertXMLToObject(objectModel:XML):ObjectModel{
				var object:ObjectModel = new ObjectModel();
				for each(var value:XML in objectModel.children()){
					if(value.localName() == "Attribute"){
						object.attributeXML = value;
					}else{
						object[value.localName()] = value.text().toString();
					}
				}
				return object;
			}
			
			public function writeBinaryFile(name : String, array : ByteArray) : String {
				try {
					var f : File = File.desktopDirectory.resolvePath(name);
					var fs : FileStream = new FileStream();
					fs.open(f, FileMode.WRITE);
					fs.writeBytes(array);
					fs.close();
					return f.nativePath + " written.";
				}
				catch (err : Error) {
					return err.name;
				}
				return "Error writing file.";
			}

This air app will generate file name "om" on desktop. The file "om" has a as3 objects containing information of XML's

Code in Apllication, (embed om file into application)

			[Embed(source="om", mimeType="application/octet-stream")]
			private var om:Class;
	
			protected function application1_creationCompleteHandler(event:FlexEvent):void
			{
				// TODO Auto-generated method stub
				registerClassAlias("ObjectModel", ObjectModel); //registering vo class ObjectModel with application
				
				var byteArray:ByteArrayAsset = ByteArrayAsset(new om());
				var object:Object = byteArray.readObject();
				if(object is ObjectModel){  //If you don't register "ObjectModel" class then app will not need info successfully.
					trace("true");
					//read object information directly instead of extracting information from xml.
				}
			}


Common Library Code of VO: (This library swc containing various VO's will be shared among air and runtime app)
//For example, I am showing single demo class
public class ObjectModel
	{
		private var _policyName:String;
		private var _policyNumber:String;
		private var _amount:String;
		private var _attributeXML:XML;
		public function ObjectModel()
		{
		}

		public function get policyName():String
		{
			return _policyName;
		}

		public function set policyName(value:String):void
		{
			_policyName = value;
		}

		public function get policyNumber():String
		{
			return _policyNumber;
		}

		public function set policyNumber(value:String):void
		{
			_policyNumber = value;
		}

		public function get amount():String
		{
			return _amount;
		}

		public function set amount(value:String):void
		{
			_amount = value;
		}

		public function get attributeXML():XML
		{
			return _attributeXML;
		}

		public function set attributeXML(value:XML):void
		{
			_attributeXML = value;
		}


	}



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division  
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701 
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com

||yatha dristi, tatha sristi||


-----Original Message-----
From: Manish Sharma [mailto:manish_sharm@hcl.com] 
Sent: Wednesday, July 24, 2013 12:06 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Hi Raju,

Can you please define this with a small piece of code.

Regards,
Manish

-----Original Message-----
From: Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] 
Sent: Tuesday, July 23, 2013 4:59 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Thanks Maurice, it did worked.

Created a AIR application which will generate a VO's from XML's. (Vo class is shared in between air application and main application) Then generated VO's are dumped into hard disk by using ByteArray.
Dumped file then embedded into running application.
By using ByteArray.readObject taken binaray data.
Type casted object to VO class by using registerClassAsAlias method.

Smoothly working :)


-----Original Message-----
From: Maurice Amsellem [mailto:maurice.amsellem@systar.com]
Sent: Monday, July 22, 2013 10:19 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Possible solution:
Use serialization =>
1) Built a utility that will parse the XML , convert them to VOs, serialize the VOs and save the result as a binary file, all at "build" time.
2) embed the binary file into your app.
3) Then at runtime,  read the embedded file then deserialize to get back the VOs.

Maurice 


-----Message d'origine-----
De : Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] Envoyé : lundi 22 juillet 2013 18:22 À : users@flex.apache.org Objet : Performance issue's

Hi,
I am facing performance issue with application which plays with xml's

Problem is:

1.       There are too many heavy xml embedded in flex modules swf.

2.       After load of these module we start parsing that xml's in to VO's. (Value Object a simple as3 object)

3.       We use these VO's at different part of application as and when necessary.
While, Profiling application using 'flash builder profiler' I encountered that step 2(parsing xml's and converting it to Vo's) is taking more time and responsible for many loitering of xml objects.

Solution is:

1.       I want a utility which will generate a swf which will have as3 VO's converted from xml's.

2.       Application will load that swf file and start using that VO's directly.
That means I wanted a readymade VO's so that my parsing time will be reduced.

Implementation?
So how can I embed as3 objects instead of xml's into swf/modules?
Or
How can I convert xml's into as3 VO's at compile time? (I am ready with compile time overhead than runtime)

Clue is:
In BlazeDS, We can convert Java objects into as3 objects.
So similarly can we convert xml's into as3 or xml's into java objects then into as3 objects?



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com<http://www.mastek.com/>

||yatha dristi, tatha sristi||

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


RE: Performance issue's

Posted by Manish Sharma <ma...@hcl.com>.
Hi Raju,

Can you please define this with a small piece of code.

Regards,
Manish

-----Original Message-----
From: Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] 
Sent: Tuesday, July 23, 2013 4:59 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Thanks Maurice, it did worked.

Created a AIR application which will generate a VO's from XML's. (Vo class is shared in between air application and main application) Then generated VO's are dumped into hard disk by using ByteArray.
Dumped file then embedded into running application.
By using ByteArray.readObject taken binaray data.
Type casted object to VO class by using registerClassAsAlias method.

Smoothly working :)


-----Original Message-----
From: Maurice Amsellem [mailto:maurice.amsellem@systar.com]
Sent: Monday, July 22, 2013 10:19 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Possible solution:
Use serialization =>
1) Built a utility that will parse the XML , convert them to VOs, serialize the VOs and save the result as a binary file, all at "build" time.
2) embed the binary file into your app.
3) Then at runtime,  read the embedded file then deserialize to get back the VOs.

Maurice 


-----Message d'origine-----
De : Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] Envoyé : lundi 22 juillet 2013 18:22 À : users@flex.apache.org Objet : Performance issue's

Hi,
I am facing performance issue with application which plays with xml's

Problem is:

1.       There are too many heavy xml embedded in flex modules swf.

2.       After load of these module we start parsing that xml's in to VO's. (Value Object a simple as3 object)

3.       We use these VO's at different part of application as and when necessary.
While, Profiling application using 'flash builder profiler' I encountered that step 2(parsing xml's and converting it to Vo's) is taking more time and responsible for many loitering of xml objects.

Solution is:

1.       I want a utility which will generate a swf which will have as3 VO's converted from xml's.

2.       Application will load that swf file and start using that VO's directly.
That means I wanted a readymade VO's so that my parsing time will be reduced.

Implementation?
So how can I embed as3 objects instead of xml's into swf/modules?
Or
How can I convert xml's into as3 VO's at compile time? (I am ready with compile time overhead than runtime)

Clue is:
In BlazeDS, We can convert Java objects into as3 objects.
So similarly can we convert xml's into as3 or xml's into java objects then into as3 objects?



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com<http://www.mastek.com/>

||yatha dristi, tatha sristi||

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------


RE: Performance issue's

Posted by "Raj U. Shaikh" <Ra...@mastek.com>.
Thanks Maurice, it did worked.

Created a AIR application which will generate a VO's from XML's. (Vo class is shared in between air application and main application)
Then generated VO's are dumped into hard disk by using ByteArray.
Dumped file then embedded into running application.
By using ByteArray.readObject taken binaray data.
Type casted object to VO class by using registerClassAsAlias method.

Smoothly working :)


-----Original Message-----
From: Maurice Amsellem [mailto:maurice.amsellem@systar.com] 
Sent: Monday, July 22, 2013 10:19 PM
To: users@flex.apache.org
Subject: RE: Performance issue's

Possible solution:
Use serialization => 
1) Built a utility that will parse the XML , convert them to VOs, serialize the VOs and save the result as a binary file, all at "build" time.
2) embed the binary file into your app.
3) Then at runtime,  read the embedded file then deserialize to get back the VOs.

Maurice 


-----Message d'origine-----
De : Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] 
Envoyé : lundi 22 juillet 2013 18:22
À : users@flex.apache.org
Objet : Performance issue's

Hi,
I am facing performance issue with application which plays with xml's

Problem is:

1.       There are too many heavy xml embedded in flex modules swf.

2.       After load of these module we start parsing that xml's in to VO's. (Value Object a simple as3 object)

3.       We use these VO's at different part of application as and when necessary.
While, Profiling application using 'flash builder profiler' I encountered that step 2(parsing xml's and converting it to Vo's) is taking more time and responsible for many loitering of xml objects.

Solution is:

1.       I want a utility which will generate a swf which will have as3 VO's converted from xml's.

2.       Application will load that swf file and start using that VO's directly.
That means I wanted a readymade VO's so that my parsing time will be reduced.

Implementation?
So how can I embed as3 objects instead of xml's into swf/modules?
Or
How can I convert xml's into as3 VO's at compile time? (I am ready with compile time overhead than runtime)

Clue is:
In BlazeDS, We can convert Java objects into as3 objects.
So similarly can we convert xml's into as3 or xml's into java objects then into as3 objects?



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com<http://www.mastek.com/>

||yatha dristi, tatha sristi||

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


RE: Performance issue's

Posted by Maurice Amsellem <ma...@systar.com>.
Possible solution:
Use serialization => 
1) Built a utility that will parse the XML , convert them to VOs, serialize the VOs and save the result as a binary file, all at "build" time.
2) embed the binary file into your app.
3) Then at runtime,  read the embedded file then deserialize to get back the VOs.

Maurice 


-----Message d'origine-----
De : Raj U. Shaikh [mailto:Raj.Shaikh@mastek.com] 
Envoyé : lundi 22 juillet 2013 18:22
À : users@flex.apache.org
Objet : Performance issue's

Hi,
I am facing performance issue with application which plays with xml's

Problem is:

1.       There are too many heavy xml embedded in flex modules swf.

2.       After load of these module we start parsing that xml's in to VO's. (Value Object a simple as3 object)

3.       We use these VO's at different part of application as and when necessary.
While, Profiling application using 'flash builder profiler' I encountered that step 2(parsing xml's and converting it to Vo's) is taking more time and responsible for many loitering of xml objects.

Solution is:

1.       I want a utility which will generate a swf which will have as3 VO's converted from xml's.

2.       Application will load that swf file and start using that VO's directly.
That means I wanted a readymade VO's so that my parsing time will be reduced.

Implementation?
So how can I embed as3 objects instead of xml's into swf/modules?
Or
How can I convert xml's into as3 VO's at compile time? (I am ready with compile time overhead than runtime)

Clue is:
In BlazeDS, We can convert Java objects into as3 objects.
So similarly can we convert xml's into as3 or xml's into java objects then into as3 objects?



Thanks & Regards,
Raj Shaikh
Senior Software Engineer

Majesco Mastek - P&C Division
Mastek Millennium Center, A-7, Millennium Business Park, Sector 1 Off Thane Belapur Road, Mahape Navi Mumbai - 400701
 (T) 91 22 27781272 Extn - 5250 | Mobile: 9970395965 | Fax: 91 22 27781332 | www.mastek.com<http://www.mastek.com/>

||yatha dristi, tatha sristi||

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Performance issue's

Posted by Alex Harui <ah...@adobe.com>.

On 7/22/13 9:22 AM, "Raj U. Shaikh" <Ra...@mastek.com> wrote:

>Hi,
>I am facing performance issue with application which plays with xml's
>
>Problem is:
>
>1.       There are too many heavy xml embedded in flex modules swf.
>
>2.       After load of these module we start parsing that xml's in to
>VO's. (Value Object a simple as3 object)
Other people have performance issues here as well.  An alternative
solution to pre-computing the VO's at compile time is to use lazy or
on-demand XML to VO conversion.  There is a prototype of a LazyCollection
that does JSON to VO conversion in the FlexJS prototype.  Source is in the
asjs repo.

In general, performance will benefit from doing things like conversion
on-demand.  For sure if you can know it at compile-time that is usually
the best, but keep in mind that even VO's are not linked into the SWF as a
block of binary memory.  Code will still run at some point in time to
either parse the AMF stream, and/or create instances of VO's and populate
them with properties.  If you generate 100K objects at startup and only
use 10 of them at a time, you might still be better off with lazy
conversion at runtime.

Also, some folks even implement fancy VO's that lazily convert sub-objects
of the VO.  One XML data set I saw had 50 records, but each record had the
entire transaction history of the customer, each of which had 1000's of
transactions.  The initial screen just showed customer name and not the
transaction history, so there was no point in converting 50,000
transaction records just to see the list of customer names.  It was later,
when you selected the actual customer to drill-down that the 1000 records
for that customer was converted.

-Alex