-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Description
I recently wondered why TextDecoding was so slow. Several seconds for 50-100 Kbytes (I am running on a low power embedded system with single core performance comparable to RPI 1).
I saw it currently uses a JS only implementation. I am wondering why, the JS_NewStringLen of quickjs already handles utf8 doesn't it?
As a workaround I am currently using
import FFI from 'tjs:ffi';
export function quickDecodeUtf8(buf) {
return FFI.bufferToString(buf);
}
Which also just does a JS_NewString.
The opposite case of Encoding isn't quite as slow, but it seems JS_ToCString would also handle this case.
Though maybe I am missing something, e.g. some feature TextEncoder/TextDecoder which would not be happening/handled in the quickjs functions.
Metadata
Metadata
Assignees
Labels
No labels