Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuMarkn
Visitor

Re: How to make it faster ?

Ok, I see. In your XML document, the content of the <Result> item is another embedded, escaped XML document. This is rather unusual, but certainly legal. So if you want to pick apart the contents of the Result item, then yes, you should do another parse on only the contents of the Result item.

--Mark
0 Kudos
greubel
Visitor

Re: How to make it faster ?

I added the second parse().
Parse 1 is processing the entire XML with the embedded escaped XML.
Parse 2 is the XML that has been unescaped by the first parse() into a single field.
Why is the first parse taking so long ?
The second parse has the same data, about 95% of the first parse but unescaped.

12:46:08.222 XML Times for 40374 items = 50 <---- total bytes and # of items
12:46:08.234 XML parse 1 = 3551 <---- time is in MS ( 3.5 seconds )
12:46:08.244 XML scan 1 = 7 <---- time shows that there are very few fields
12:46:08.254 XML parse 2 = 66
12:46:08.265 XML scan 2 = 287
12:46:08.274 XML setup = 76
0 Kudos
RokuMarkn
Visitor

Re: How to make it faster ?

Can you PM me a sample of an XML file that takes 3+ seconds to parse?

--Mark
0 Kudos
greubel
Visitor

Re: How to make it faster ?

OMG ! I hate windows !
I got a transfer last night that was 171K for 27 items and it took over 30 seconds to get out of the first parse().
0 Kudos
RokuMarkn
Visitor

Re: How to make it faster ?

What model and what firmware version are you testing on? I tried the first sample you sent me on a XS running unreleased firmware, and it parsed in about 900ms, much less than your result of 3228ms.

--Mark
0 Kudos
greubel
Visitor

Re: How to make it faster ?

HD, N1000 also tried it on Roku 2  3100X 
The Roku2 is about half the time.
0 Kudos
RokuMarkn
Visitor

Re: How to make it faster ?

Ok, it appears the problem has nothing to do with escaping the characters, but simply that the one Result item is so large (38K in your first example). If I arbitrarily split this into 20 smaller items (by adding 19 instances of "</Result><Result>"), the parse time drops from 600ms to 29ms. I will file a bug report on this.

--Mark
0 Kudos
greubel
Visitor

Re: How to make it faster ?

Thank You !
0 Kudos
greubel
Visitor

Re: How to make it faster ?

Any progress ?
0 Kudos
RokuMarkn
Visitor

Re: How to make it faster ?

Ah, I guess I need to set expectations.
I have filed this as a bug. The bug will be prioritized and should be addressed in a future release. I have no idea when that release will be at this time. I wouldn't expect a solution in anything like a matter of a few days however.

--Mark
0 Kudos