Forums Register Login

Getting a huge String data from a server

+Pie Number of slices to send: Send
I'm getting an XML data from our business partner's server.

They basically return the XML in one huge String.
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://../../">string</string>

The program that I run in our server to get this data seems to take a lot of CPU usages.
I believe this is because the way they send out the data in one huge String.

This is the line of code where it takes a lot of the CPU usages.
String data = callMethodToGetXML();

Any advice how should I approach this?
Thanks in advance for the help.
+Pie Number of slices to send: Send
are you processing the xml file as you get it, or simply saving it? give some more context and people will be able to help more.

if it is a size issue can you get it in compressed form? if not could you have an xml iterator that got it in chunks say 1000 rows per invocation until you were done. essentially each remote call would get 1000 rows until the process returned the entire file.
+Pie Number of slices to send: Send
Are you sure it's taking up a lot of CPU cycles there? As opposed to, say, memory? Or just spending time waiting for IO from a file or network? It seems odd that a method named callMethodToGetXML() would take a lot of CPU time. Where does it get the XML from? Can you get any data about how the time is spent within that method?
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 525 times.
Similar Threads
xml creation from db
xml file from db
Problem XML Parsing
Performance Issue: JSP responses rendering on IE
to generate xml file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:12:56.