TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Making Chrome on Windows Faster with PGO

140 pointsby zmodemover 8 years ago

7 comments

alfalfasproutover 8 years ago
I&#x27;ve been experimenting with profile-guided optimization and link-time optimization now on a variety of applications I&#x27;ve been developing.<p>A couple of things I&#x27;ve noticed:<p>1. PGO most benefits whenever you have branching logic in &#x27;hot&#x27; code (either inside a tight loop or as part of a dispatch function that&#x27;s repeatedly called). If set up correctly, the conditional can be reordered or the code structured so that you get very good branch predictions. This often means that code that wasn&#x27;t automatically vectorized before can now be reorganized to employ SIMD instructions (usually this means a worse delay in case of a branch miss though).<p>2. Your dependent functions must be in the same compilation unit if you want to take advantage of many of the optimizations. Yes, interprocedural optimization (LTO) is a thing, but it&#x27;s not perfect. If you have a loop that calls a function that can be inlined, the compiler does a great job with PGO ensuring that everything is hot in the instruction cache. If you put those functions in another compilation unit, not so much.<p>3. If you want to use PGO, you better use extremely representative inputs. The performance of a project compiled with PGO will suffer greatly if you use unrepresentative inputs.
评论 #12843031 未加载
评论 #12842397 未加载
magicalistover 8 years ago
this twitter thread makes the post somewhat more interesting: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;BruceDawson0xB&#x2F;status&#x2F;793177917949739008" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;BruceDawson0xB&#x2F;status&#x2F;793177917949739008</a><p>Specifically, (one reason) why this wasn&#x27;t done years ago[1] and bugs found when switched to PGO[2]<p>[1] <a href="https:&#x2F;&#x2F;connect.microsoft.com&#x2F;VisualStudio&#x2F;feedback&#x2F;details&#x2F;1064219&#x2F;ltcg-linking-of-chromes-pdf-dll-spends-60-of-time-in-c2-dll-ssrfree" rel="nofollow">https:&#x2F;&#x2F;connect.microsoft.com&#x2F;VisualStudio&#x2F;feedback&#x2F;details&#x2F;...</a><p>[2] <a href="https:&#x2F;&#x2F;randomascii.wordpress.com&#x2F;2016&#x2F;03&#x2F;24&#x2F;compiler-bugs-found-when-porting-chromium-to-vc-2015&#x2F;" rel="nofollow">https:&#x2F;&#x2F;randomascii.wordpress.com&#x2F;2016&#x2F;03&#x2F;24&#x2F;compiler-bugs-f...</a>
SaveTheRbtzover 8 years ago
The article is a bit shallow. It would be nice to see:<p>1. What flavours of PGO optimizations were applied? What was the isolated impact of each one of them on both speed and size of the code?<p>2. What tests did they use to &quot;guide&quot; PGO?<p>3. How did they analyze PGO results(except for these three tests that were provided)? I assume they did not blindly trust it, therefore there should be a way of visualizing differences between two binaries with millions of lines of code.<p>4. How did PGO affect crash statistics?
bitmapbrotherover 8 years ago
Always a nice win when you can use tools to speed up your code. The only unfortunate part is that it&#x27;s platform specific.
评论 #12842488 未加载
评论 #12843042 未加载
fowl2over 8 years ago
In case anyone was wondering about other browsers - Firefox has been doing PGO, and dealing with bugs - for quite some time: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Mozilla&#x2F;Developer_guide&#x2F;Build_Instructions&#x2F;Building_with_Profile-Guided_Optimization" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Mozilla&#x2F;Developer_g...</a>
cm2187over 8 years ago
Sort of unrelated but one more example of responsive design gone wrong. The chart overflows outside of the page on an iphone, and by locking the scaling, I can&#x27;t zoom out to view it.<p>Another example of a page that would be more readable had it sticked to plain old html.
评论 #12841477 未加载
评论 #12842452 未加载
评论 #12841559 未加载
polskibusover 8 years ago
Has PGO been applied to V8 as part of Chrome ?
评论 #12841328 未加载