• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting a huge String data from a server  RSS feed

 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!