0

I am currently in need of processing a formatted XML to an unformatted single line XML. I had gone through this SO answer for my reference.

However, my formatted XML string has 3500 lines. On using the method mentioned on the above answer shared, it is currently taking more than 18ms for processing my XML.

Is there a faster way to do this, at the rate of 5ms for 3500 lines?

Mike
  • 721
  • 1
  • 17
  • 44
  • Is 18 milliseconds really too long? Are you sure this isn't premature optimization? – Slaw Jul 29 '19 at 11:18
  • 1
    I will be received thousands of request XML per second Slaw. And 18ms is slow for that. – Mike Jul 29 '19 at 12:52
  • Can you make any assumptions about the incoming XML? For example, can you assume that there are not line-break characters that you have to retain? If you can make this assumption then you can just replace all line-breaks by blanks. – Daniel Junglas Aug 01 '19 at 06:58

0 Answers0