Skip to content

Commit ee543df

Browse files
committed
Realization striked me
1 parent 5b7d763 commit ee543df

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ When we receive a 1× payload and decode it we have 2× (UTF-8 if Latin chars) t
4343

4444
The payload may be malformed, but to discover this we must incrementally parse it — the job of `JSON.parse`. We would rather skip the intermediate string entirely, identify problems early and protect the application under high load.
4545

46+
Even if there is only one UTF-16 char in the string, it becomes twice as large in any case. If strings were parsed only one by one and inserted into the resulting structure, it would have MOST of the data UTF-8 and one 1 string UTF-16. This HUGELY improves performance of i18n services.
47+
4648
---
4749

4850
Results of [Decoding benchmark](./demo/decoding.mjs) — 4 MB symbols, 100 iterations:

0 commit comments

Comments
 (0)