Summary: | [JSC] Add fast path for String#localeCompare | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, dbates, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Yusuke Suzuki
2019-10-07 19:35:11 PDT
I've tried small improvement and gets significantly better result: if string is all-ascii, use ucol_strcollUTF8. Created attachment 382164 [details]
Patch
Created attachment 382165 [details]
Patch
Created attachment 382166 [details]
Patch
Created attachment 382215 [details]
Patch
Comment on attachment 382215 [details]
Patch
r=me. Do we already have test cases for 8bit vs 8bit, 16 bit vs 16bit, 8bit vs 16bit, and 16bit vs 8bit localeCompare? If not, can you add this test to make sure there's no bug introduced here? Also an API test to verify that StringView::isAllASCII() is working would also be nice. Thanks.
(In reply to Mark Lam from comment #6) > Comment on attachment 382215 [details] > Patch > > r=me. Do we already have test cases for 8bit vs 8bit, 16 bit vs 16bit, 8bit > vs 16bit, and 16bit vs 8bit localeCompare? If not, can you add this test to > make sure there's no bug introduced here? Also an API test to verify that > StringView::isAllASCII() is working would also be nice. Thanks. Oops, I forgot uploading the test. Committed r251736: <https://trac.webkit.org/changeset/251736> |