On Thu, Oct 9, 2025 at 10:59 PM Zeeshan Abid <[email protected]> wrote: > > I wanted your guys thoughts because you probably know more than me but > according to people atTC39. We should be changing localeCompare so it is > faster. > It should check if the comparison is with ASCII or UNICODE then go through a > fast or a slow path
V8 has that fast path in LocaleCompareFastPath but it iterates over the strings char-at-a-time, whereas it could be using word-at-a-time or SIMD at least some of the time*, so there's maybe still room for improvement. * Char-at-a-time iteration makes it easy for LocaleCompareFastPath to handle mixed one-byte and two-byte strings. For word-at-a-time, it would need four versions of the inner loop, two where the left and right strides are of different sizes. Not impossible, but somewhat awkward and inefficient. -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/v8-dev/CAHQurc_nTB9w6vEdnZDjvEWsb4ZDXvhSwUpYys4Ub0tZ-hVxJw%40mail.gmail.com.
