Hey guys,
I'm trying to deal with large XML packets I'm receiving from IntelliSync. The
packets in question represent emails with possible attachments, so they can get
quite large. I'm getting serious overhead using XmlParse(). Here is my test
code:
<CFFILE action="read" file="c:\temp\test.xml" variable="fileContents">
<CFSET startTime = gettickcount()>
<CFSET data = XmlParse(fileContents)>
<CFOUTPUT>#gettickcount() - startTime# ms</CFOUTPUT>
For a 2MB xml file, most of which is one large attachment, this code takes
about 1 second just to parse the XML. For a 10MB attachment (which results in
14MB of XML, due to base64 encoding), the above code takes 37 seconds. Only
200ms of which is to read the file. Most of that 37 seconds is spent with JRun
pining the CPU on my dev machine.
Researching this issue, I noted the following articles:
http://coldfusion.sys-con.com/read/41761.htm
"If you encounter one of these (large) files, you'll need to use one of the
industry-standard SAX parsers."
http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=7&threadid=833948&highlight_key=y&keyword1=large%20xml
"I'm under the impression that a SAX XML parser reads much faster and will
enable me to actually process the file in a reasonable amount of time."
http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=942
" If you want to switch the XML parser that JRun or CFMX uses it is pretty
simple..."
"I was informed by Macromedia staff that using any parser besides Crimson is
NOT supported."
Has anyone tried alternate XML parsers? Is there a way to use them without
over-writing the default parser? Honestly, I'm thinking about doing this is
.Net, where the native parser nails this 14MB file in about .7 seconds. Another
other suggestions?
-Chase
Chase Seibert | Network and Systems Engineer | Bullhorn Inc. | 617.464.2440
x119 | www.bullhorn.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211040
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54