You can create a fully deployed version, for example, through
function compileCopy(count, di, si) {
var sb = new Array(count);
di += count, si += count;
while(count--) sb[count] = --di + ']=src[' + --si;
return new Function('dst[' + sb.join('];dst[') + '];');
}
var copy = compileCopy(0x4000, 0x4000, 0x8000);
In Opera, this will be slightly faster than the loop version. In FF ... no (there might be some kind of error).
source
share