Post

TIL: Prefer `Float64Array` over `Array<number>` when you care about sorting. Sorting the former is a lot faster.

Yeah, Float64Array.sort is easy mode: with no args, we call straight into the runtime and run std::sort on the backing store (github.com/v8/v8/blob/m...). To get Array.sort close to this speed, you'd have to already have the right backing store, and then inline the comparator somehow.

Any reason to not use TimSort for TypedArray? (who should I cc?)