Slow XmlDocument::parse with new String changes

Hi, firstly, I know what I am trying to do is a rather big task (processing wise) and maybe there are better ways to go about it but this was working perfectly a couple of weeks ago and is something a lot of apps do in some form or another.

In my app I read the iTunes Music Library.xml generated by iTunes for a quick and handy way of filling in my music table. Before the String changes this used to work fine, it would would parse my 4000 track iTunes Library into Xml ready for me to do with as I wish in no time at all. Now its seems to hang with a library of any size larger than a few 100. I say hang but I’m sure it would get there eventually but I gave up after 5 minutes.

If I pause the debugger it always seems to be inside static const CharPointerType createFromCharPointer (const CharPointer& text) and void writeAll (const CharPointer_UTF32& src) throw() within the XmlDocument::parse method.

I haven’t really been following the String changes but could this be something to do with using a wider character encoding? Didn’t they use UTF-8 before? Still not sure if this would increase the parse time 1000 fold though. Any pointers would be much appreciated.


Have you tried an optimised release build?

I tried a release build generated from the Jucer that builds with -Os by default I think. Still takes way too long, 15 minutes and counting.

That’s odd, it shouldn’t be much different to before. I’ll try it myself.

Ah, it was just a slip-up in the XmlDocument class - line 607 should read:

textElementContent.appendCharPointer (start, len);

Thanks for the heads-up, I’ll get that fixed.

Brilliant, works perfectly now. Legend!