← Back to context

Comment by esperent

2 years ago

> Arrays must be of one type and a fixed length

If performance is critical then use a TypedArray where possible.

Your other points are spot on for high performance JS.

I was messing about with some profiling and seemed to find that TypedArrays are not always faster than regular arrays carefully handled. And what's worse it seemed like a regression from node 16 (fast typed arrays) to 18 (slow typed arrays). I will have to dig up my profiles again and see if I can verify it. Posting this comment in the hope that someone who knows more than me has something to add!