Hacked the code a bit, threw some debug timers in there, then executed it with WSH...
---------------------------
Windows Script Host
---------------------------
File loading time: 0 ms, Unicode time: 31672 ms, BDecode time: 312 ms, Total time: 32063 ms
The actual BDecoding seems quite efficient, the bottleneck is this dodgy Unicode conversion code...
code:
// Split the 2 bytes for each Unicode char and add them to an array. Convert both bytes from a charcode to a character.
var UInt8Array = [],charCode;
while(unicodeString.length){
charCode = unicodeString.charCodeAt(0);
UInt8Array.push(String.fromCharCode(charCode&255),String.fromCharCode(charCode>>8));
unicodeString = unicodeString.substr(1);
}
Here's a forum post where the author asks for help with that:
http://www.ozoneasylum.com/27909