kaazing / http2-cache.js

2 stars 11 forks source link

Bugs/4 byte utf8 array to str #41

Closed hthetiot closed 7 years ago

hthetiot commented 7 years ago

Implementation of Utf8ArrayToStr had an issue with 4 byte sequence. I also added usage of native TextDecoder when available.

See https://jsperf.com/utf8arraytostr for bench

hthetiot commented 7 years ago

Via @jfallows "the short-circuit to use TextDecoder will cause the other codepath to be rarely tested http://caniuse.com/#feat=textencoder the microsoft browsers do not yet have direct support for TextDecoder. also, the significantly re-written codepath for non-TextDecoder on the face of it looks like it could be slower than the original, definitely worth measuring and perhaps worth isolating the bugfix for 4+ byte sequences independent of re-writing that codepath"

hthetiot commented 7 years ago

screenshot_20170821-115236 screenshot_20170821-115139 screenshot_20170821-115033