Bug 221769 - Reduce unnecessary string copies in ParsedRequestRange and ParsedContentRange
Summary: Reduce unnecessary string copies in ParsedRequestRange and ParsedContentRange
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-11 12:11 PST by Alex Christensen
Modified: 2021-03-09 16:43 PST (History)
7 users (show)

See Also:


Attachments
Patch (10.13 KB, patch)
2021-02-11 12:12 PST, Alex Christensen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (10.11 KB, patch)
2021-02-11 13:24 PST, Alex Christensen
ggaren: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

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