Bug 221769

Summary: Reduce unnecessary string copies in ParsedRequestRange and ParsedContentRange
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, ggaren, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch ggaren: review+, ews-feeder: commit-queue-

Description Alex Christensen 2021-02-11 12:11:39 PST
Reduce unnecessary string copies in ParsedRequestRange and ParsedContentRange
Comment 1 Alex Christensen 2021-02-11 12:12:34 PST
Created attachment 420023 [details]
Patch
Comment 2 Alex Christensen 2021-02-11 13:24:11 PST
Created attachment 420035 [details]
Patch
Comment 3 Sam Weinig 2021-02-11 13:54:56 PST
If you want to be even more efficient, you can also consider adopting StringParsingBuffer + ParserUtilities.h, which avoids a bunch of the branches StringView has to do on each call by doing the branch up front. 

Just grep in WebCore for StringParsingBuffer to see some examples of it being used.
Comment 4 Alex Christensen 2021-02-11 14:20:04 PST
That's true, but I don't think there is much difference in this case because toInt64Strict and toUInt64Strict only have one check for 8-bit or 16-bit, then they call specialized parsers themselves.
Comment 5 Radar WebKit Bug Importer 2021-02-18 12:12:13 PST
<rdar://problem/74489102>
Comment 6 Geoffrey Garen 2021-03-09 16:22:23 PST
Comment on attachment 420035 [details]
Patch

r=me
Comment 7 EWS 2021-03-09 16:37:21 PST
Tools/Scripts/svn-apply failed to apply attachment 420035 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 8 Alex Christensen 2021-03-09 16:43:36 PST
r274187