jsfiddle / togetherjs

A service for your website that makes it surprisingly easy to collaborate in real-time.
https://togetherjs.com
Mozilla Public License 2.0
7.01k stars 849 forks source link

util.readFileImage optimization, 5X #1060

Open rickdog opened 9 years ago

rickdog commented 9 years ago

util.readFileImage (util.js) is 5 times faster on my Win/Firefox37 when I replace

line 302: def.resolve("data:image/jpeg;base64," + util.blobToBase64(this.result));

with: def.resolve('data:image/jpeg;base64,' + btoa(String.fromCharCode.apply(null, new Uint8Array(this.result))));