Live data from Hacker News

24-core CPU and I can’t move my mouse

randomascii.wordpress.com

181–190 of 509 posts

Re: 24-core CPU and I can’t move my mouse

#181
post #132

Earlier quoted context omitted.

> Damn, are we doing this wrong? Yes, and I mean "we" as in "this industry". I just recently talked to someone whose Swift framework(s) were compiling at roughly 16 lines per second. Spurred on by Jonathan Blow's musings on compile times for Jai[1], I started tinkering with tcc a little. It compiled a generated 200KLOC file (lots of small functions) in around 200 ms. Then there are Smalltalk and Lisp systems that are…

Bjarne's made the mistake of having C++ rely on C's linker model, so it meant no modules. Now we can see it as a big mistake, but on those days probably it was one of the reasons why C++'s adoption took off. Also while C lacked modules, most Algol and PL/I derived languages supported them since the late 60's. Swift's case has the issue of mixing type inference with subtyping, so lots of time is spent there. All in al…

OCaml uses C's linker model, and yet still manages to have working Modula-like modules (even with cross-module inlining). So there's an existence proof that it's possible to do it well.

Re: 24-core CPU and I can’t move my mouse

#182
post #118

Earlier quoted context omitted.

Doesn't link-time code generation already exist (at least on MSVC, I think). It makes the linking step so much more expensive, though, which sucks for incremental builds.

Ah, yes, I knew I had to be missing something! Needing to support incremental builds are what makes C++ compilation so frustrating. I wonder why this is so difficult though - dependency tracking should be a thing that can carry through the link stage. Just track what files a given function depend on, and only recompile/recodegen functions that have changed. Of course, it still sucks massively if you change a header f…

LTCG as of VS2015 is an incremental process when it can be, which did wonders for build times.

Re: 24-core CPU and I can’t move my mouse

#183
post #78
post #61

Earlier quoted context omitted.

> Damn, are we doing this wrong? Yes: Not isolating different modules sufficiently to allow you to avoid including most headers when compiling most modules. Patterns to do this in C++ has been well understood for two decades: Strict separation of concerns coupled with facades at the boundaries that let all the implementation details of the modules remain hidden. Yes, it has a cost: You're incurring extra call overhea…

While what you're saying might be true, I can't help but think about Pascal units and say: "It didn't have to be this hard! We solved this problem 40 years ago!"

The heir to the Pascal/Delphi kingdom seems to be Nim[0], though it takes its syntax from Python.

Compilation is impressively quick, even though it goes through C.

[0] https://nim-lang.org/

Re: 24-core CPU and I can’t move my mouse

#184
post #175

Earlier quoted context omitted.

> Damn, are we doing this wrong? Yes, and I mean "we" as in "this industry". I just recently talked to someone whose Swift framework(s) were compiling at roughly 16 lines per second. Spurred on by Jonathan Blow's musings on compile times for Jai[1], I started tinkering with tcc a little. It compiled a generated 200KLOC file (lots of small functions) in around 200 ms. Then there are Smalltalk and Lisp systems that are…

Go is a good example of a language with fast compilation times. Of course, the optimizer needs improvements, but I believe they keep managing to make it faster as they improve the output rather than slower.

Wasn't that Wirth's rule for Oberon and/or Pascal? Any optimization introduced has to have sufficient cost vs. benefit ratio that it makes the compiler faster compiling itself.

Re: 24-core CPU and I can’t move my mouse

#186

Earlier quoted context omitted.

Makes me wonder about a distributed compilation. If everyone had a monster workstation but not everyone compiles at the same time, a theoretical networked compiler (which may already exist as I haven't really checked) could spread the files out among available workstations and bring things back together near the end. As the largest issue is the throwing away of duplicate work, I'd see it as a kind of reverse binary t…

Isn't this what IncrediBuild does on Windows?

It is. Although, as far as I'm informed (having last used it in 2013 or so), even with that approach, you'll likely have problems linking all the output in the end if your project is large enough.

Of course, thats another separate problem to begin with. I still remember dabbling with D and vibe.d and replacing the default GNU linker with ld.gold because over 90% of the build time was due to the linker...

Re: 24-core CPU and I can’t move my mouse

#187

Earlier quoted context omitted.

Makes me wonder about a distributed compilation. If everyone had a monster workstation but not everyone compiles at the same time, a theoretical networked compiler (which may already exist as I haven't really checked) could spread the files out among available workstations and bring things back together near the end. As the largest issue is the throwing away of duplicate work, I'd see it as a kind of reverse binary t…

https://wiki.archlinux.org/index.php/Distcc I used that 10+ years ago on Gentoo, and never saw anyone using it since. Don't know how often is used now days.

I used it ~3 years ago on Funtoo; there's definitely still people that use it!

Re: 24-core CPU and I can’t move my mouse

#188
I feel like the (brilliant post) is missing the context that if you were debugging the latency on Linux, you would have the source code to continue the investigation until you found and fixed the problem, as opposed to just teeing it up for Microsoft.

Re: 24-core CPU and I can’t move my mouse

#189

Earlier quoted context omitted.

> Damn, are we doing this wrong? Yes, and I mean "we" as in "this industry". I just recently talked to someone whose Swift framework(s) were compiling at roughly 16 lines per second. Spurred on by Jonathan Blow's musings on compile times for Jai[1], I started tinkering with tcc a little. It compiled a generated 200KLOC file (lots of small functions) in around 200 ms. Then there are Smalltalk and Lisp systems that are…

I used to be a C++ guy for 20 years, but won't go back unless absolutely necessary. I mean, it's tempting -- there are some cool new language features. I find that the abstractions are leaky, though, so you still have to understand all the hairy edge-cases. The language has gone insane. I'm 40 -- I want to get stuff done before I die, not play clever games to get around my language / system.

I've given up on C++ 5 years ago, after 10 years of getting paid to develop it. I find out the extra money that come from a C++ job doesn't cover the gray hairs of trying to tame the language so you don't shoot yourself in the foot a dozen times every time you call a method.

Re: 24-core CPU and I can’t move my mouse

#190
post #45

Full disclosure: I work for Google on Chrome. A Chrome build is truly a computational load to be reckoned with. Without the distributed build, a from-scratch build of Chrome will take at least 30 minutes on a Macbook Pro--maybe an hour(!). TBH I don't remember toughing out a full build without resorting to goma. Even on a hefty workstation, a full build is a go-for-lunch kind of interruption. It will absolutely own a…

> Damn, are we doing this wrong?

Give me a tool that's: (i) as fast, (ii) as mature and well supported, (iii) as powerful as C++ and I will switch in a heartbeat. But until there is such an alternative it's futile to complain about the shortcomings of C++, because if you want the powerful, zero-cost abstractions, the mountains of support, and access to billions of existing lines of code, you pretty much have nowhere else to go.

Post reply on HN