[Webkit-unassigned] [Bug 228122] Expand URL class query parameter functions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 30 17:46:12 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=228122

--- Comment #21 from Risul Islam <risul_islam at apple.com> ---
Comment on attachment 434669
  --> https://bugs.webkit.org/attachment.cgi?id=434669
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434669&action=review

>>>>> Source/WTF/wtf/URL.cpp:1176
>>>>> +    auto otherQueryParameters = URLParser::parseURLEncodedForm(otherURL.query());
>>>> 
>>>> It seems to me would could implement this operation significantly more efficiently by sorting both vectors and walking through them, rather than using a hash table.
>>> 
>>> Wouldn't sorting be costly in terms of time? We preferred to sacrifice some memory. Although the length of the URL and the number of the parameter is not that huge, still we can discuss about any kind of optimization.
>> 
>> No, I don’t think so.
> 
> We would be sorting a vector of pairs of pointers. It should not be more costly than hash tables. Both should be O(n log n). Including the speed of the memory allocation, I expect the sorting algorithm would be both faster and use less memory.

Clear now. Thanks Darin.

>>>> Source/WTF/wtf/URL.h:207
>>>> +    WTF_EXPORT_PRIVATE void removeQueryParameters(const HashSet<String>&);
>>> 
>>> How did you decide that these should be members of the URL class rather than functions that take a URL? In particular, the ones that take two URLs seem like they should be functions that take two URLs.
>> 
>> I am sorry I am a little bit unclear here. It would be very helpful if I could be a bit clear.
> 
> Example:
> 
>     bool areEqualIgnoringQueryAndFragments(const URL&, const URL&);

Got it. Thank you for the clarification.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210731/5e09bc7d/attachment.htm>


More information about the webkit-unassigned mailing list