Bug 263216 - Stop using StringView::operator[] in hot code paths in WebCore
Summary: Stop using StringView::operator[] in hot code paths in WebCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-16 14:02 PDT by Chris Dumez
Modified: 2023-10-16 21:47 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>