User talk:Pedro Oval/Base64 HMAC MD5

From Second Life Wiki
Jump to navigation Jump to search

Suggestions

If you change "T = llList2Integer(x,i);" to "T = llList2Integer(x,~i);" you don't need to reverse the order of x (allowing you to discard the "x = [H4, H3, H2, H1];"). You might find User:Strife_Onizuka/int2hexdword interesting.

(One of) The reason(s) LSO is so slow is that it copies every parameter during a function call, if you used a Global for "b64", "H[1-4]" and "i" values it would be much faster (as you would be duplicating the variable fewer times). Of course doing so is evil. -- Strife (talk|contribs) 22:23, 16 December 2010 (UTC)

Thank you. I've implemented the first one, but after giving a a try at the globals idea and performing a timing comparison, I concluded that the time used in parameter passing must be negligible compared with the processing time, because I noticed no timing difference. The only pitfall I see is that the extra nesting level could pose a memory problem in LSO with the passing of a long b64, but making it global is too yucky. AFAIK Mono strings don't suffer that problem, and using this function in LSO is somewhere between masochist and suicidal anyway. -- Pedro Oval 02:36, 22 December 2010 (UTC)
Definitely masochistic and correct about Mono. Using globals has to be done very carefully otherwise you introduce new bugs, not worth the effort unless you have memory problems (in LSO it was a major concern so I spent a large amount of time optimizing code... not always for speed). -- Strife (talk|contribs) 04:01, 22 December 2010 (UTC)