Difference in performance between calling .localeCompare on string objects and constructing a purpose-made Intl.Collator object?
问题 Background: So I need to sort lots of strings. Arrays of strings, actually, but that's besides the point. What isn't is that I need to implement my own sorter function, as detailed in the linked question.Performance is quite important to me. jFriend00 very helpfully suggested that I use String.prototype.localeCompare . The arrays I'm sorting are 100K+ elements long, and so performance is pretty important. On the MDN doc for .localeCompare, under Performance , it says: When comparing large