Performance of Low Level String Decoding in JavaScript

Peter Makes Websites
6 min readSep 14, 2022

tl;dr: TextDecoder is really fast for bigger strings. Very small strings (< 18 char ish) can actually benefit from using a simple custom decoder using an array.

JavaScript is a very high level programming language. Most languages have characters and strings and can manipulate them differently. In JavaScript, that’s simply not the case. You have a very limited amount you can do. It’s the trade off of having very simple syntax. You don’t have as much control.

--

--

Peter Makes Websites

Sharing my experience of web & app development with the world