Bug 263216

Summary: Stop using StringView::operator[] in hot code paths in WebCore
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Layout and RenderingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Chris Dumez 2023-10-16 14:02:16 PDT
Stop using StringView::operator[] in hot code paths in WebCore. StringView's operator[] is not super efficient because it needs to check the is8Bit flag for every character when iterating. I am also looking into adding a boundary check in StringView::operator[], which would further increase branching.
Comment 1 Chris Dumez 2023-10-16 14:08:19 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19130
Comment 2 EWS 2023-10-16 21:45:59 PDT
Committed 269396@main (9ad44599784a): <https://commits.webkit.org/269396@main>

Reviewed commits have been landed. Closing PR #19130 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-10-16 21:47:16 PDT
<rdar://problem/117055068>