[webkit-reviews] review denied: [Bug 133990] Refactor to remove unnecessary code from the string hashing functions : [Attachment 233248] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 23 09:11:20 PDT 2014


Daniel Bates <dbates at webkit.org> has denied  review:
Bug 133990: Refactor to remove unnecessary code from the string hashing
functions
https://bugs.webkit.org/show_bug.cgi?id=133990

Attachment 233248: Patch
https://bugs.webkit.org/attachment.cgi?id=233248&action=review

------- Additional Comments from Daniel Bates <dbates at webkit.org>
Looking over the patch again, I agree with Darin Adler's and Benjamin Poulain's
remarks in comment #5 and comment #6, respectively, that this patch removes an
optimization to avoid an iteration over the specified LChar string to be added
to the table. Specifically this patch increases the algorithmic complexity of
add() by a factor of N (the length of the LChar string to add to the table)
when the string already exists in the table.

Without the proposed patch the cost to add a string S with length N that
already exists in the table is O(2N) = "cost to hash S" (O(N)) + "cost to
perform an equality operation to ensure that a match with the same hash is
identical to S" (O(N)). With the proposed patch the cost becomes O(3N) = "cost
to compute strlen(S)" (O(N)) + "cost to hash S" (O(N)) + "cost to perform an
equality operation to ensure that a match with the same hash is identical to S"
(O(N)).


More information about the webkit-reviews mailing list