by glymor · 8y ago · 0 comments
"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-incrementa...
[2] PGO = Profile Guided Optimization
1. https://bugs.chromium.org/p/chromium/issues/detail?id=580389...
Depends. Virtual calls can be done purely in code, with different implementation files you need to go round via the build system. The former just always works independent of platform whereas often for the latter it's more configuration work. Also, ignoring YAGNI, you could say the virtual one makes it easy to quickly test things out etc, is easily mockable, ...
I don't fully understand the proposal here. Do you have an example of a code in the wild that uses the proposed scheme?
// widget.h
class Widget { virtual void throb(); };
// widget.cc
class WidgetImpl : public Widget { void throb() { ... } };
class WidgetTest : public Widget { void throb() { ... } };
then, instead of that, just do // widget.h
class Widget { void throb(); };
// widget.cc
void Widget::throb() { ... }
// widget.test.cc
void Widget::throb() { ... }
where you only compile widget.cc for the production build, and only compile widget.test.cc for the test build.Feel free to post a more specific example and I can take a stab at seeing if I can make this transformation to it (or why it might not be possible, if you think it's not).
Because that’s what we need, more magic in the build system.