4 ms·
A reply in the thread from David Major about performance: "At the moment, performance is a mixed bag. Some tests are up and some are down. In particular I beli
by glymor 8y ago
A reply in the thread from David Major about performance:
"At the moment, performance is a mixed bag. Some tests are up and some are down. In particular I believe Speedometer is down a few percent."
"Note however that clang-cl is punching above its weight. These builds currently have neither LTO nor PGO, while our MSVC builds use both of those. Any regressions that we're seeing ought to be short-lived. Once we enable LTO[1] and PGO[2], I expect clang to be a clear performance win."
[1] "LTO (Link Time Optimization) is a method for achieving better runtime performance through whole-program analysis and cross-module optimization."
http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html http://blog.llvm.org/2016/06/thinlto-scalable-and-incrementa...
[2] PGO = Profile Guided Optimization
- kjeetgill 8y agoInteresting. Do they collect profiles from Nightly users or do they have some internal characteristic workload?
- gsnedders 8y agoIt's based on the perf tests, which I think are all public.
- krasin 8y agoLTO can be particularly handy when doing devirtualization. Our experience ([1]) with Chromium demonstrated that there's a fair amount of virtual methods which have exactly two implementation in the code: one for production and another one for tests. While linking production code, it's trivial for this optimization to spot that, replace a virtual call with regular invocation and then often inline and allow for other in-place optimizations. In many cases of the renderer (Blink), that gives 3%-7% speedup out of nowhere. 1. https://bugs.chromium.org/p/chromium/issues/detail?id=580389#c25 https://bugs.chromium.org/p/chromium/issues/detail?id=580389...
- simcop2387 8y agoThat's really cool. I've primarily seen LTO benefits on the more embedded side of things where it ends up enabling far more aggressive dead code elimination between code and libraries which makes it much easier to fit into small chips. I hadn't thought much about virtual methods with C++ code (uncommon to see those in embedded code to begin with).
- mehrdadn 8y agoOut of curiosity, why use virtual calls in those cases? Why not just have two different implementation files -- one for tests, and one for production -- and choose one based on which one you're doing? It seems like a win all around.
- fulafel 8y agoThere's always performance hacks to be found in big apps, in exchange for implementation complexity and man-hours. And there's always a next bottleneck to be found. Performnace bugs are subject to an extended form of survivorship bias where they become bigger when the preceding perf bottlenecks get fixed.
- mehrdadn 8y agoI've refreshed and seen three major revisions of your comment after writing a full reply to the first one, and I can't say I've been able to clearly follow where you're coming from and where you're going with any of them. I would suggest that if you feel the need for such drastic revisions, it may be worth reconsidering whether whatever you're trying to argue is really compelling.
- slededit 8y agoHis advice is sage and you should look past whatever deficiencies you find in his form of communication. Simply put there's always bigger fish to fry, and virtual methods are a quick and easy way to implement test stubs. Especially when the compiler devirtualizes.
- mehrdadn 8y agoWell I had a response to that originally but his edits kind of changed how much sense my reply made in response. Here's what I had: Performance is only one aspect of it. It also reduces code bloat, reducing the program's size footprint. Most tests (yes, I know, not all, but most) should not make it into the final binary users are running. I also don't see what's "hacky" about making a foo.test.cc file when I want an alternate implementation for foo.cc. It seems to be quite a positive and clear way to document the fact that an implementation is only needed for testing, and vice-versa. And not only that, but it reduces compile (& link) times, since you only need to compile one of the two implementations for each use case.