On 7/22/13 9:22 AM, "Raj U. Shaikh" <[email protected]> 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
