xmlParse is fast, reading the array is not so fast.
I'm trying to work with xml files that can have up to 5000 children.
On larger files reading the xmlText starts to get timely.
Yesterday I spent the good part of a day trying to optimize strings in coldfusion just to find out the concatenation wasn't my bottle neck.
I'm working with xml documents and xmlparse. xmlparse() works fine and quickly.
I have parsed and output a small 30 child document. cftimer proved that outputting the data took 0ms.
I have parsed a large 3500 child document but only looped through the first 30. cftimer proved that to take 1390ms. getting through the entire document takes about 2:15 seconds.
This leads me to believe the parsed xml is causing some memory issues.
Does anyone know any optimization settings or a solution I'm not seeing to speed up working with the large structures?
The files I need to work with can contain up to 5000 children.
I'm using CF standard 8.
<cfoutout>
<cfloop from = "1" to = "30" index = "i">
<cfif structKeyExists(xml.x.y,"send")>
(#session.id#,'#xml.x.y.id.xmlText#',
#xml..x.y.send.xmlText#,'#xml.x.y.time.xmlText#',
'#trim(xml.x.y.region.xmlText)#','#trim(replace(xml.x.y.description.xmlText, "'", "''"))#',
'#xml.x.y.name.xmlText#','#xml.x.y.type.xmlText#',
'#xml.x.y.account_balance.xmlText#'),
<cfelse>
(#session. id#,'#xml..x.y.id.xmlText#',
#xml..x.y.receive.xmlText*-1#,'#xml.x.y.time.xmlText#',
'#trim(xml.x.y.region.xmlText)#','#trim(replace(xml.x.y.description.xmlText, "'", "''"))#',
'#xml.x.y.name.xmlText#','#xml.x.y.type.xmlText#',
'#xml.x.y.account_balance.xmlText#'),
</cfif>
</cfloop>
</cfoutput>
