Jan Hubicka

hubicka.blogspot.com · Personal blog · on HN since 2014

Jan Hubicka, a GCC developer, writes about link-time and interprocedural optimization, devirtualization, and benchmarking big programs like Firefox and LibreOffice.

What HN saysHN links him as the authority on GCC devirtualization and LTO. Commenters cite his posts, and one points to his GCC 9 post as more current.
25HN people shared it
10linked it in comments
21stories submitted
728story points
10 months agolast shared
2014people per year2026

Most-shared posts

  1. 1
  2. 2
    Building libreoffice with GCC 6 and LTO
    5 people · 6 points · first shared 2016 · discussion on HN
  3. 3
  4. 4
    Firefox 64 built with GCC and Clang
    2 people · 198 points · first shared 2018 · 63 comments on HN
  5. 5
    Linktime optimization in gcc 2 firefox
    2 people · first shared 2014
  6. 6
    Devirtualization in c part 5 feedback
    2 people · first shared 2014
  7. 7
    GCC 8 Link Time and Interprocedural Optimization
    1 people · 143 points · first shared 2018 · 8 comments on HN
  8. 8
  9. 9
    Link-time optimization in GCC, part 3 – LibreOffice
    1 people · 100 points · first shared 2014 · 19 comments on HN
  10. 10
  11. 11
    Devirtualization in C++, part 6 – asking user for help
    1 people · 31 points · first shared 2014 · discussion on HN
  12. 12
  13. 13
    Building LibreOffice with GCC 6 and LTO
    1 people · 6 points · first shared 2016 · discussion on HN
  14. 14
    Link-time optimization in GCC: A brief history
    1 people · 4 points · first shared 2014 · discussion on HN
  15. 15
    Linktime optimization in GCC, part 1 – brief history
    1 people · 3 points · first shared 2016 · discussion on HN

What HN people wrote when they linked it

pcwalton · 2014-06-09
> Most our perf issues were with limiting draw calls and optimizing shaders, not method calling. Sounds like the work done by tree traversals weren't high overhead in general for your workload. But it does matter for some workloads. > Similarly, I worked a lot on a browser engine in the past and virtual method dispatch was again not this clear cut performance killer. We're seeing large gains from, as far as we can tell, having fewer virtual method calls than other engines. Eliminating virtual dispatch opens up a huge range of call-site optimizations since the methods can often be statically inlined (as well as reducing the load on the branch target buffer). > Similarly, I worked a lot on a browser engine in the past and virtual method dispatch was again not this clear cut performance killer. That doesn't match my experience. Devirtualization opens up lots of inlining opportunities, and inlining is one of the most critical optimizations that compilers can do (mostly because of the other optimizations that it opens up; e.g. const propagation, GVN, etc. etc.) See this study: http://hubicka.blogspot.com/2014/04/devirtualization-in-c-part-5-feedb… Devirtualization optimizations improve Dromaeo by 7-8%. That's a significant win, especially since devirtualization is only a best-effort optimization and Dromaeo has a lot of JS in it.
khuey · 2026-01-13
Compilers will also speculatively devirtualize under some circumstances. https://hubicka.blogspot.com/2014/02/devirtualization-in-c-part-4-anal…
Kranar · 2021-09-14
Jan Hubička worked on much of the devirtualization in GCC and posted a blog about how it works here: http://hubicka.blogspot.com/2014/01/devirtualization-in-c-part-1.html
Supersaiyan_IV · 2020-08-21
This article is way too outdated. Also, who the heck uses -flto on GCC 4.7.1? LTO is experimental in GCC 4.7.1 and will make any application nigh-impossible to debug. Here's something more relevant to modern times: http://hubicka.blogspot.com/2019/05/gcc-9-link-time-and-inter-procedur…
diegocg · 2019-05-03
Related link: GCC 9: Link-time and inter-procedural optimization improvements https://hubicka.blogspot.com/2019/05/gcc-9-link-time-and-inter-procedu…
hubicka · 2018-12-31
It is Google's blogger.com. I am not very advanced user of it and generally just use whatever it provides for me. The link is off. This link http://hubicka.blogspot.com/2018/12/even-more-fun-with-building-and.ht… renders better in general. PS: I found it too ironic to mention in the blog, but I had to uninstall mobile firefox to get the two-level application needed to submit a patch :)). For some reason Google authentificator requires over 30MB to take a picture of bar code.
twoodfin · 2016-11-11
Some C++ compilers support "fast path" devirtualization via profiling feedback: http://hubicka.blogspot.com/2014/04/devirtualization-in-c-part-5-feedb… As you suggest, it's a little misleading to talk about the runtime cost of a virtual or indirect function call in isolation. The most significant cost is often the resulting inability of the compiler to inline and perform further optimizations across the caller and callee.
octoploid · 2016-04-27
Correction. Clang used to compile much faster years ago. But nowadays GCC-6 actually compiles faster than clang-3.8.0. See e.g.: http://hubicka.blogspot.com/2016/03/building-libreoffice-with-gcc-6-an…
uxcn · 2016-01-26
Not that I prefer Java where performance is important, but profile based optimization combined with optimizing across translation units is non-trivial. C/C++ compilers have been increasing support for these more recently. Jan Hubicka's blog has a good example [1]. I have to wonder if they plan to keep the codebase portable though. One of the major benefits of Java was that nearly everything has a JVM. [1] http://hubicka.blogspot.com/2014/04/linktime-optimization-in-gcc-2-fir…
azakai · 2016-04-02
Yes, LLVM was designed with speed in mind. However, look at how much faster compile times are in JS VMs compared to LLVM; LLVM's slow compile times are why none of them use it, even though they tried (e.g. WebKit which is dropping LLVM). A lot of SSA-based JITs are just a lot faster than LLVM. I think it's a matter of tradeoffs. LLVM has multiple IRs on the way to machine code, some quite large, which let it emit pretty good output, on par with gcc. But other designs are possible that avoid a lot of that overhead, and can be far faster than LLVM, like JS VMs, B3 [1] and SubZero [2]. And clang is overall more or less comparable with gcc these days in terms of speed, it's no longer clearly faster [3] (although that also takes into account the frontend). With all that said, I agree with you that making such a decision without talking to LLVM is a little silly. But, I doubt it would change the outcome: If Go wants fast compile times, has the resources to write its own compiler, and is ok with trading off throughput for compile time, then it's a reasonable decision to avoid LLVM. [1] https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/ [2] https://github.com/stichnot/subzero [3] http://hubicka.blogspot.com/2016/03/building-libreoffice-with-gcc-6-an…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close