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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 30 17:10:42 PDT 2021


--- Comment #19 from Darin Adler <darin at apple.com> ---
Comment on attachment 434669
  --> https://bugs.webkit.org/attachment.cgi?id=434669

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.

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/e755301e/attachment.htm>

More information about the webkit-unassigned mailing list