diff --git a/text.js b/text.js index dd9257c..d927c1d 100644 --- a/text.js +++ b/text.js @@ -55,8 +55,8 @@ FastTextEncoder.prototype['encode'] = function(string, options={stream: false}) const len = string.length; let at = 0; // output position - let tlen = Math.max(32, len + (len >> 1) + 7); // 1.5x size - let target = new Uint8Array((tlen >> 3) << 3); // ... but at 8 byte offset + let tlen = Math.max(32, len + (len >>> 1) + 7); // 1.5x size + let target = new Uint8Array((tlen >>> 3) << 3); // ... but at 8 byte offset while (pos < len) { let value = string.charCodeAt(pos++); @@ -78,7 +78,7 @@ FastTextEncoder.prototype['encode'] = function(string, options={stream: false}) if (at + 4 > target.length) { tlen += 8; // minimum extra tlen *= (1.0 + (pos / string.length) * 2); // take 2x the remaining - tlen = (tlen >> 3) << 3; // 8 byte offset + tlen = (tlen >>> 3) << 3; // 8 byte offset const update = new Uint8Array(tlen); update.set(target); @@ -89,14 +89,14 @@ FastTextEncoder.prototype['encode'] = function(string, options={stream: false}) target[at++] = value; // ASCII continue; } else if ((value & 0xfffff800) === 0) { // 2-byte - target[at++] = ((value >> 6) & 0x1f) | 0xc0; + target[at++] = ((value >>> 6) & 0x1f) | 0xc0; } else if ((value & 0xffff0000) === 0) { // 3-byte - target[at++] = ((value >> 12) & 0x0f) | 0xe0; - target[at++] = ((value >> 6) & 0x3f) | 0x80; + target[at++] = ((value >>> 12) & 0x0f) | 0xe0; + target[at++] = ((value >>> 6) & 0x3f) | 0x80; } else if ((value & 0xffe00000) === 0) { // 4-byte - target[at++] = ((value >> 18) & 0x07) | 0xf0; - target[at++] = ((value >> 12) & 0x3f) | 0x80; - target[at++] = ((value >> 6) & 0x3f) | 0x80; + target[at++] = ((value >>> 18) & 0x07) | 0xf0; + target[at++] = ((value >>> 12) & 0x3f) | 0x80; + target[at++] = ((value >>> 6) & 0x3f) | 0x80; } else { continue; // out of range } @@ -142,6 +142,7 @@ FastTextDecoder.prototype['decode'] = function(buffer, options={stream: false}) // Accept Uint8Array instances as-is. let bytes = buffer; + let inputIndex = 0; // Look for ArrayBufferView, which isn't a real type, but basically represents // all the valid TypedArray types plus DataView. They all have ".buffer" as @@ -150,59 +151,66 @@ FastTextDecoder.prototype['decode'] = function(buffer, options={stream: false}) bytes = new Uint8Array(buffer.buffer); } - let pos = 0; - let pending = []; + // Create a working buffer for UTF-16 code points, but don't generate one + // which is too large for small input sizes. UTF-8 to UCS-16 conversion is + // going to be at most 1:1, if all code points are ASCII. The other extreme + // is 4-byte UTF-8, which results in two UCS-16 points, but this is still 50% + // fewer entries in the output. + const pendingSize = Math.min(256 * 256, buffer.length + 1); + const pending = new Uint16Array(pendingSize); const chunks = []; + let pendingIndex = 0; for (;;) { - const more = pos < bytes.length; + const more = inputIndex < bytes.length; - // If there's no more data or we're >65k bytes, create a chunk. - // This isn't done at the end by simply slicing the data into equal sized - // chunks as we might hit a surrogate pair. - if (!more || (pos & 0x10000)) { - chunks.push(String.fromCharCode.apply(null, pending)); + // If there's no more data or there'd be no room for two UTF-16 values, + // create a chunk. This isn't done at the end by simply slicing the data + // into equal sized chunks as we might hit a surrogate pair. + if (!more || (pendingIndex >= pendingSize - 1)) { + // nb. .apply and friends are *really slow*. Low-hanging fruit is to + // expand this to literally pass pending[0], pending[1], ... etc, but + // the output code expands pretty fast in this case. + chunks.push(String.fromCharCode.apply(null, pending.subarray(0, pendingIndex))); if (!more) { return chunks.join(''); } // Move the buffer forward and create another chunk. - pending = []; - bytes = bytes.subarray(pos); - pos = 0; + bytes = bytes.subarray(inputIndex); + inputIndex = 0; + pendingIndex = 0; } // The native TextDecoder will generate "REPLACEMENT CHARACTER" where the // input data is invalid. Here, we blindly parse the data even if it's // wrong: e.g., if a 3-byte sequence doesn't have two valid continuations. - const byte1 = bytes[pos++]; - if (byte1 === 0) { - pending.push(0); - } else if ((byte1 & 0x80) === 0) { // 1-byte - pending.push(byte1); + const byte1 = bytes[inputIndex++]; + if ((byte1 & 0x80) === 0) { // 1-byte or null + pending[pendingIndex++] = byte1; } else if ((byte1 & 0xe0) === 0xc0) { // 2-byte - const byte2 = bytes[pos++] & 0x3f; - pending.push(((byte1 & 0x1f) << 6) | byte2); + const byte2 = bytes[inputIndex++] & 0x3f; + pending[pendingIndex++] = ((byte1 & 0x1f) << 6) | byte2; } else if ((byte1 & 0xf0) === 0xe0) { // 3-byte - const byte2 = bytes[pos++] & 0x3f; - const byte3 = bytes[pos++] & 0x3f; - pending.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); + const byte2 = bytes[inputIndex++] & 0x3f; + const byte3 = bytes[inputIndex++] & 0x3f; + pending[pendingIndex++] = ((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3; } else if ((byte1 & 0xf8) === 0xf0) { // 4-byte - const byte2 = bytes[pos++] & 0x3f; - const byte3 = bytes[pos++] & 0x3f; - const byte4 = bytes[pos++] & 0x3f; + const byte2 = bytes[inputIndex++] & 0x3f; + const byte3 = bytes[inputIndex++] & 0x3f; + const byte4 = bytes[inputIndex++] & 0x3f; // this can be > 0xffff, so possibly generate surrogates let codepoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; if (codepoint > 0xffff) { // codepoint &= ~0x10000; codepoint -= 0x10000; - pending.push((codepoint >>> 10) & 0x3ff | 0xd800); + pending[pendingIndex++] = (codepoint >>> 10) & 0x3ff | 0xd800; codepoint = 0xdc00 | codepoint & 0x3ff; } - pending.push(codepoint); + pending[pendingIndex++] = codepoint; } else { // invalid initial byte } diff --git a/text.min.js b/text.min.js index 9627738..0cda2f2 100644 --- a/text.min.js +++ b/text.min.js @@ -1,5 +1,5 @@ -(function(l){function m(){}function k(c,a){c=void 0===c?"utf-8":c;a=void 0===a?{fatal:!1}:a;if(-1===n.indexOf(c.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+c+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1;var n=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(c, -a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var g=c.length,f=0,b=Math.max(32,g+(g>>1)+7),e=new Uint8Array(b>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(b+=8,b*=1+a/c.length*2,b=b>>3<<3,h=new Uint8Array(b),h.set(e),e=h);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]= -d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice?e.slice(0,f):e.subarray(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode=function(c,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported."); -a=c;!(a instanceof Uint8Array)&&a.buffer instanceof ArrayBuffer&&(a=new Uint8Array(c.buffer));c=0;for(var g=[],f=[];;){var b=c>>10&1023|55296),b=56320|b&1023);g.push(b)}}};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); +(function(l){function m(){}function k(e,b){e=void 0===e?"utf-8":e;b=void 0===b?{fatal:!1}:b;if(-1===p.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(b.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1;var p=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(e, +b){b=void 0===b?{stream:!1}:b;if(b.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");b=0;for(var f=e.length,d=0,h=Math.max(32,f+(f>>>1)+7),c=new Uint8Array(h>>>3<<3);b=a){if(b=a)continue}d+4>c.length&&(h+=8,h*=1+b/e.length*2,h=h>>>3<<3,g=new Uint8Array(h),g.set(c),c=g);if(0===(a&4294967168))c[d++]=a;else{if(0===(a&4294965248))c[d++]= +a>>>6&31|192;else if(0===(a&4294901760))c[d++]=a>>>12&15|224,c[d++]=a>>>6&63|128;else if(0===(a&4292870144))c[d++]=a>>>18&7|240,c[d++]=a>>>12&63|128,c[d++]=a>>>6&63|128;else continue;c[d++]=a&63|128}}return c.slice?c.slice(0,d):c.subarray(0,d)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode=function(e,b){b=void 0===b?{stream:!1}:b;if(b.stream)throw Error("Failed to decode: the 'stream' option is unsupported."); +b=e;var f=0;!(b instanceof Uint8Array)&&b.buffer instanceof ArrayBuffer&&(b=new Uint8Array(e.buffer));e=Math.min(65536,e.length+1);for(var d=new Uint16Array(e),h=[],c=0;;){var a=f=e-1){h.push(String.fromCharCode.apply(null,d.subarray(0,c)));if(!a)return h.join("");b=b.subarray(f);c=f=0}a=b[f++];if(0===(a&128))d[c++]=a;else if(192===(a&224)){var g=b[f++]&63;d[c++]=(a&31)<<6|g}else if(224===(a&240)){g=b[f++]&63;var n=b[f++]&63;d[c++]=(a&31)<<12|g<<6|n}else if(240===(a&248)){g=b[f++]& +63;n=b[f++]&63;var q=b[f++]&63;a=(a&7)<<18|g<<12|n<<6|q;65535>>10&1023|55296,a=56320|a&1023);d[c++]=a}}};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); diff --git a/text.min.js.map b/text.min.js.map index 7d96d5d..7e8e5e9 100644 --- a/text.min.js.map +++ b/text.min.js.map @@ -2,7 +2,7 @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,EAA/BA,CAAwCH,CAAxCG,EAAiD,EAAjDA,CAA0DF,CAA1DE,EAAmE,CAAnEA,CAA2ED,CAC/D,MAAhB,CAAIC,CAAJ,GAEEA,CAEA,EAFa,KAEb,CADAd,CAAA,CAAQG,CAAA,EAAR,CACA,CAD2BW,CAC3B,GADyC,EACzC,CAD+C,IAC/C,CADuD,KACvD,CAAAA,CAAA,CAAY,KAAZ,CAAqBA,CAArB,CAAiC,IAJnC,CAMAd,EAAA,CAAQG,CAAA,EAAR,CAAA,CAA0BW,CAbQ,CApC7B,CA1BqE,CAkFhFpD,EAAA,YAAA,CAAuBC,CACvBD,EAAA,YAAA,CAAuBE,CAtMN,CAAhB,CAAA,CAwMmB,WAAlB,GAAA,MAAOmD,OAAP,CAAgCA,MAAhC,CAA4D,WAAlB,GAAA,MAAOC,OAAP,CAAgCA,MAAhC,CAAyC,IAxMpF;", "sources":["text.js"], -"names":["scope","FastTextEncoder","FastTextDecoder","utfLabel","options","fatal","validUtfLabels","indexOf","toLowerCase","RangeError","Error","Object","defineProperty","prototype","value","string","stream","pos","len","length","at","tlen","Math","max","target","Uint8Array","charCodeAt","extra","update","set","slice","subarray","buffer","bytes","ArrayBuffer","pending","chunks","more","push","String","fromCharCode","apply","join","byte1","byte2","byte3","byte4","codepoint","window","global"] +"names":["scope","FastTextEncoder","FastTextDecoder","utfLabel","options","fatal","validUtfLabels","indexOf","toLowerCase","RangeError","Error","Object","defineProperty","prototype","value","string","stream","pos","len","length","at","tlen","Math","max","target","Uint8Array","charCodeAt","extra","update","set","slice","subarray","buffer","bytes","inputIndex","ArrayBuffer","pendingSize","min","pending","Uint16Array","chunks","pendingIndex","more","push","String","fromCharCode","apply","join","byte1","byte2","byte3","byte4","codepoint","window","global"] }