News for hackers. Stuff that matters.
Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @01:26AM (#17504642)
I'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.
Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @01:33AM (#17504662)
His 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.
Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @01:37AM (#17504680)
Well 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.

Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @02:11AM (#17504788)
Yea all things being equal I'd choose your approach. But in an existing project that did things this way - it would be the last thing I'd touch. This is of course barring extreme circumstances - which profiling and other tools would identify.

Unfortunately a lot of C++ developers don't really understand how the linker works, and because of that the build system is black magic.

Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @02:30AM (#17504856)
Yeah, I wasn't suggesting they immediately dispatch a team for transforming everything into this. But at least from now on they could try to get people to use this pattern, and make the move gradually.
Re:Firefox switching to clang-cl for Windows builds by slededit on Wednesday July 11, 2018 @03:55AM (#17505186)
I want to reiterate what I think the broader point is - If this is the most pressing problem you have a very highly functioning team. There's only so much bandwidth for change and I frequently see it get spent poorly.
Re:Firefox switching to clang-cl for Windows builds by fulafel on Wednesday July 11, 2018 @01:52AM (#17504721)
Sorry! That's a risk you have when following comments tightly :)

I'll reconstruct my first take from memory if you have comments on it:

Current CPUs are pretty good at predicting indirect branches, and it's hard to tell beforehand which virtual calls still turn out to be perf problems - and it's wasted effort and a fallible process to attempt their compllete elimination beforehand.

Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @01:56AM (#17504733)
Right, and I posted my reply to that here: https://news.ycombinator.com/item?id=17504680