On Tue, Oct 9, 2012 at 4:21 AM, Maciej Stachowiak <span dir="ltr">&lt;<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">One preliminary finding of ours is that different web pages fairly often load identical resource bodies from different URLs. We expect possible benefits from sharing the body data of resources in memory even if we cannot share the URL or response headers.</div>
</blockquote><div> </div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I did some preliminary profiling of this earlier. The data is not necessarily very representative of the web as whole, I simply browsed through a number of popular sites with an instrumented build (<a href="https://bug-98539-attachments.webkit.org/attachment.cgi?id=167753" target="_blank" style="color:rgb(17,85,204)">https://bug-98539-attachments.webkit.org/attachment.cgi?id=167753</a>). Here is what I had in the WebCore memory cache in the end:</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>TOTAL duplicates count=443 size=852791 decodedSize=3426638</div><div>all cached resources count=2636 size=116463712</div><div><br></div><div>17% of cache entries are exact copies of previous entries. They use 4.3MB out of total 116MB cache size (4%). The average size of duplicate entries is much smaller than the average entry size (not surprisingly, transparent 1x1 images etc).</div>
<div><br></div><div>Some examples:</div><div><br></div><div>HTTP vs. HTTPS:</div><div><br></div><div>hash=5d90af size=91556 decodedSize=34834 <a href="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" target="_blank" style="color:rgb(17,85,204)">https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js</a></div>
<div>hash=5d90af size=91556 decodedSize=32 <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" target="_blank" style="color:rgb(17,85,204)">http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js</a></div>
<div><br></div><div>(decodedSize for js resources is the size of the function offset cache which can differ depending which functions have been parsed).</div><div><br></div><div>Ad scripts with deliberately unique URLs:</div>
<div><br></div><div>hash=6f6494 size=3111 decodedSize=32 <a href="http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=76273718" target="_blank" style="color:rgb(17,85,204)">http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=76273718</a>?</div>
<div>hash=6f6494 size=3111 decodedSize=648 <a href="http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=711567314" target="_blank" style="color:rgb(17,85,204)">http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=711567314</a>?</div>
<div>hash=6f6494 size=3111 decodedSize=32 <a href="http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=908690779" target="_blank" style="color:rgb(17,85,204)">http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=908690779</a>?</div>
<div>hash=6f6494 size=3111 decodedSize=32 <a href="http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=876087584" target="_blank" style="color:rgb(17,85,204)">http://ad.doubleclick.net/adj/teg.fmsq/j2ek;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90,970x90;tile=1;ord=876087584</a>?</div>
<div><br></div><div>Same framework loaded by multiple unrelated sites:</div><div><br></div><div>hash=230c7d size=1958 decodedSize=0 <a href="http://static.iltalehti.fi/js/measure/spring.js" target="_blank" style="color:rgb(17,85,204)">http://static.iltalehti.fi/js/measure/spring.js</a></div>
<div>hash=230c7d size=1958 decodedSize=1536 <a href="http://yle.fi/global/spring/spring.js" target="_blank" style="color:rgb(17,85,204)">http://yle.fi/global/spring/spring.js</a></div><div><br></div><div>(didn&#39;t see as many of these as expected though i&#39;m sure there are sites that run into this)</div>
<div><br></div><div>Copy-paste resources:</div><div><br></div><div>hash=8fb3e size=3965 decodedSize=13088 <a href="http://store.storeimages.cdn-apple.com/2149/store.apple.com/rs/source/store/base/nav/globalnav/css/bg/globalsearch_spinner.gif" target="_blank" style="color:rgb(17,85,204)">http://store.storeimages.cdn-apple.com/2149/store.apple.com/rs/source/store/base/nav/globalnav/css/bg/globalsearch_spinner.gif</a></div>
<div>hash=8fb3e size=3965 decodedSize=13088 <a href="http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/source/store/features/search/css/bg/spinner.gif" target="_blank" style="color:rgb(17,85,204)">http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/source/store/features/search/css/bg/spinner.gif</a></div>
<div>hash=8fb3e size=3965 decodedSize=13088 <a href="http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/source/store/base/nav/globalnav/css/bg/globalsearch_spinner.gif" target="_blank" style="color:rgb(17,85,204)">http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/source/store/base/nav/globalnav/css/bg/globalsearch_spinner.gif</a></div>
<div>hash=8fb3e size=3965 decodedSize=13088 <a href="http://images.apple.com/global/nav/images/globalsearch_spinner.gif" target="_blank" style="color:rgb(17,85,204)">http://images.apple.com/global/nav/images/globalsearch_spinner.gif</a></div>
<div><br></div><div>Versioning:</div><div><br></div><div>hash=cecbad size=184899 decodedSize=0 <a href="http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/applestore-rs-2.css" target="_blank" style="color:rgb(17,85,204)">http://store.storeimages.cdn-apple.com/2150/store.apple.com/rs/applestore-rs-2.css</a></div>
<div>hash=cecbad size=184899 decodedSize=0 <a href="http://store.storeimages.cdn-apple.com/2149/store.apple.com/rs/applestore-rs-2.css" target="_blank" style="color:rgb(17,85,204)">http://store.storeimages.cdn-apple.com/2149/store.apple.com/rs/applestore-rs-2.css</a></div>
<div><br></div><div>hash=47a8de size=20041 decodedSize=7870 <a href="http://js.t.sinajs.cn/open/analytics/js/suda.js?version=b4d67909ad6b5b7d" target="_blank" style="color:rgb(17,85,204)">http://js.t.sinajs.cn/open/analytics/js/suda.js?version=b4d67909ad6b5b7d</a></div>
<div>hash=47a8de size=20041 decodedSize=7870 <a href="http://tjs.sjs.sinajs.cn/open/analytics/js/suda.js" target="_blank" style="color:rgb(17,85,204)">http://tjs.sjs.sinajs.cn/open/analytics/js/suda.js</a></div><div><br></div>
<div>Multiple content servers:</div><div><br></div><div>hash=8e976b size=808 decodedSize=13088 <a href="http://i0.sinaimg.cn/home/deco/2008/0329/sinahome_0803_ws_003_new.gif" target="_blank" style="color:rgb(17,85,204)">http://i0.sinaimg.cn/home/deco/2008/0329/sinahome_0803_ws_003_new.gif</a></div>
<div>hash=8e976b size=808 decodedSize=71700 <a href="http://i3.sinaimg.cn/home/deco/2008/0329/sinahome_0803_ws_003_new.gif" target="_blank" style="color:rgb(17,85,204)">http://i3.sinaimg.cn/home/deco/2008/0329/sinahome_0803_ws_003_new.gif</a></div>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Based on this I think this is definitely worth at least looking further.</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">  antti</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You can also expect that we won&#39;t push forward blindly on this effort if data ultimately shows it to be a bad idea, or in general not worth the complexity.<br>
<br>
Regards,<br>
Maciej<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
webkit-dev mailing list<br>
<a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
<a href="http://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">http://lists.webkit.org/mailman/listinfo/webkit-dev</a><br>
</div></div></blockquote></div><br>