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: 
greubel
Visitor

Re: How to make it faster ?

Any way to get a heads up ?
0 Kudos
greubel
Visitor

Re: How to make it faster ?

This brings up another issue. Roku does these magic periodic updates in the night and then things aren't the same. (mostly better)
But can Roku post a change list of what went into the rollout ? It would help us developers to know what to test or lookout for !
0 Kudos
gonzotek
Visitor

Re: How to make it faster ?

"greubel" wrote:
This brings up another issue. Roku does these magic periodic updates in the night and then things aren't the same. (mostly better)
But can Roku post a change list of what went into the rollout ? It would help us developers to know what to test or lookout for !
The SDK sometimes contains notes about what functionality is available from which firmware version onward (e.g. see the ECP Guide). But it's not always consistent, and sometimes several firmware updates will happen before the SDK docs get updated. So I'd also welcome dedicated release notes, made available at the same time as a firmware update, and targeted at developers. Something like what Google does with Chrome releases would be very much appreciated!
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
greubel
Visitor

Re: How to make it faster ?

Any progress on the parse() taking too long ?
0 Kudos
EnTerr
Roku Guru

Re: How to make it faster ?

"greubel" wrote:
This is the fastest I've come up with to unescape the characters.

itm = txt.Tokenize( "&" )
txt = ""
for i=0 to itm.Count()-1
fld = itm[i].Tokenize( ";" )
if fld.Count() = 1
if Lcase(fld[0]) = "gt"
fld[0] = ">"
elseif Lcase(fld[0]) = "lt"
fld[0] = "<"
elseif Lcase(fld[0]) = "amp"
fld[0] = "&amp;"
elseif Lcase(fld[0]) = "quot"
fld[0] = Q
else
fld[0] = "&" + itm[i]
end if
else
if Lcase(fld[0]) = "gt"
fld[0] = ">" + fld[1]
elseif Lcase(fld[0]) = "lt"
fld[0] = "<" + fld[1]
elseif Lcase(fld[0]) = "amp"
fld[0] = "&amp;" + fld[1]
elseif Lcase(fld[0]) = "quot"
fld[0] = Q + fld[1]
else
fld[0] = fld[0] + ";" + fld[1]
end if
for j=2 to fld.Count()-1
fld[0] = fld[0] + ";" + fld[j]
end for
end if
txt = txt + fld[0]
end for

Wouldn't it be faster if instead of sequence of comparisons you use dictionary lookup (AKA "rich man's switch()")? Comes case-insensitive pre-bundled:
BrightScript Debugger> deAmp = {gt:">", lt:"<", amp:"&", quot:chr(34)}     
BrightScript Debugger> ? deAmp["GT"]
>

Also, do you guys (+TheEndless) have somewhere posted sample XML against which doing benchmarks? I feel bummed about how roXML guts texts, i am tempted to write my own parser. from what i gather, currently roXML is so-close-and-yet-completely-useless for parsing XHTML.
0 Kudos
greubel
Visitor

Re: How to make it faster ?

I had some test code in my channel that ran a comparison of MY way verses parse() every time the Roku level changed, waiting for a fix. Well sometime back in Aug, the timings reversed and parse() became faster. So I've been using that instead of my routine. But the trick is you have to parse() it TWICE. Once to get the xml in to a usable string which converts all the XML escaping and then again, just the XML to get the final result.

I WISH Roku would post the changes that went into an update. That way us poor developers would know what to check and not wait till our channel breaks.
0 Kudos