Strive to keep using the original request KURL instead of replacing it with identical copies.
<rdar://problem/14504835>
Created attachment 207211 [details] Patch idea
This feels kinda hackish. Would love to hear from someone with loader expertise.
I agree, it feel hackish.
This is a 963 kB saver on theverge.com as well. Basically any site that uses huge data: URIs will see great improvement from fixing this.
Comment on attachment 207211 [details] Patch idea Each of these 3 call sites focus on setting a KURL to another KURL. To be less hacky and to make experimenting with this optimization more centralized, I wonder if KURL's operator== should do this itself?
That would definitely give us maximum memory savings, but would possibly be a performance hit... at which point we could scale it back and only do the optimization conditionally.
(In reply to comment #6) > (From update of attachment 207211 [details]) > Each of these 3 call sites focus on setting a KURL to another KURL. > > To be less hacky and to make experimenting with this optimization more centralized, I wonder if KURL's operator== should do this itself? Something like.. if KURL::operator== will return true, it should first set m_string of both KURLs to whichever string has more refs?
(In reply to comment #8) > (In reply to comment #6) > > (From update of attachment 207211 [details] [details]) > > Each of these 3 call sites focus on setting a KURL to another KURL. > > > > To be less hacky and to make experimenting with this optimization more centralized, I wonder if KURL's operator== should do this itself? > > Something like.. if KURL::operator== will return true, it should first set m_string of both KURLs to whichever string has more refs? Sure. Looking at operator== right now, it's so simplistic... those days are over! :)
LOL - I bet doing this will uncover some threading errors. Perfect time for this!
CRAP dude. sorry. I'm not awake yet. I meant operator=, not operator==.
(In reply to comment #11) > CRAP dude. sorry. I'm not awake yet. > > I meant operator=, not operator==. That makes a bit more sense yeah :)
Comment on attachment 207211 [details] Patch idea Retracting this patch for now.