Description[url] Reserve output buffer for various URL parsing paths
This patch moves buffer reservation to the internals of //url code,
whereas previously this was the caller's (e.g. GURL, KURL)
responsibility.
The reason for this change was that KURL was *not* doing any buffer reservation,
so a naive exponential buffer growth algorithm was being used. Rather than
expecting all callers to be bug free, this patch opts to always do the right thing.
For a ~1.5MB data URL, this yields a ~13% improvement of
DoCanonicalizePathComponent<char, unsigned>, which translates to a ~8%
improvement for the overall KURL::init.
BUG=657978
Review-Url: https://codereview.chromium.org/2617173003
Cr-Commit-Position: refs/heads/master@{#444558}
Committed: https://chromium.googlesource.com/chromium/src/+/96b890e58809d310e0b70029913e0f72a00a4414
Patch Set 1 #Patch Set 2 : scheme #Patch Set 3 : do what brettw suggests #Patch Set 4 : Just comments / formatting (trybots prev) #Patch Set 5 : more comment #
Total comments: 4
Patch Set 6 : brettw review #
Messages
Total messages: 27 (14 generated)
|