News for hackers. Stuff that matters.
Re:GCC 4.9.0 released by jds375 on Tuesday April 22, 2014 @12:12PM (#7628526)
One particularly impressive improvement: "Memory usage building Firefox with debug enabled was reduced from 15GB to 3.5GB; link time from 1700 seconds to 350 seconds" - http://gcc.gnu.org/gcc-4.9/changes.html
Re:GCC 4.9.0 released by octoploid on Tuesday April 22, 2014 @12:28PM (#7628624)
"When LTO is used". For more info about LinkTimeOptimization and Firefox see the recent blog post from one of its main implementors: http://hubicka.blogspot.com/2014/04/linktime-optimization-in...
Re:GCC 4.9.0 released by _pmf_ on Tuesday April 22, 2014 @02:07PM (#7629293)
> Memory usage building Firefox with debug enabled was reduced from 15GB to 3.5GB; link time from 1700 seconds to 350 seconds

Why does using LTO reduce link time? It would expect the result to be smaller, but transient memory usage to be significantly higher.

Re:GCC 4.9.0 released by joosters on Tuesday April 22, 2014 @02:10PM (#7629306)
It doesn't reduce link time, the comparison is between LTO link times for old & new gcc.
Re:GCC 4.9.0 released by pdq on Tuesday April 22, 2014 @12:14PM (#7628534)
This is excellent:

  GCC 4.9 provides a complete implementation of the Go 1.2.1 release.
Re:GCC 4.9.0 released by personZ on Tuesday April 22, 2014 @01:54PM (#7629203)
This is a really interesting aspect. gccgo was intended to be the very high performance compiler for Go (with the intermediate compilation that could benefit from the many years of optimization in GCC), versus gc which was relatively new and unoptimized. It is great to see them catch up.

Though it would be interesting to see hard benchmarks. As is I have found performance regressions when compiling with prior versions of gccgo, as compared to gc.

Re:GCC 4.9.0 released by mbrubeck on Tuesday April 22, 2014 @11:07AM (#7628100)
Previous discussion of the GCC 4.9 changelog: https://news.ycombinator.com/item?id=7578896
Re:GCC 4.9.0 released by Igglyboo on Tuesday April 22, 2014 @11:49AM (#7628378)
From the changelog

|Memory usage building Firefox with debug enabled was reduced from 15GB to 3.5GB; link time from 1700 seconds to 350 seconds.

That's pretty impressive.

Re:GCC 4.9.0 released by gtaylor on Tuesday April 22, 2014 @12:06PM (#7628487)
wow, that is. Any idea if there are any downsides or bugs resulting from this optimization? Or is this just pure win?
Re:GCC 4.9.0 released by azakai on Tuesday April 22, 2014 @12:53PM (#7628782)
It's on LTO (link time optimization), which was previously not much optimized for compilation speed. Most projects probably don't need LTO so this won't matter for them, but for projects like Firefox that do, faster LTO compilation is a great thing.
Re:GCC 4.9.0 released by riffraff on Tuesday April 22, 2014 @01:15PM (#7628922)
not being an expert of such things, could you explain to me why do you think most projects don't need LTO ? (I'm interpreting that as "won't gain much", rather than "will find optimizations unnecessary")
Re:GCC 4.9.0 released by azakai on Tuesday April 22, 2014 @05:37PM (#7630633)
In my experience things like PGO and LTO matter most in very large projects. Of course it depends on the codebase, but in general that's what I've seen.

In very large projects, fully optimizing all the code is often unneeded, and bad because fully optimized code is larger (inlining, unrolled loops, etc.). PGO lets you find what actually needs to be optimized, and you can keep the rest compact to improve load times. Vice versa, PGO can tell you what code is run immediately on load so you can order it so that happens faster, etc.

Similarly, LTO is most useful in large projects where it is not obvious to the compiler how to optimize across compilation unit boundaries - as in a small enough project, either there are few such boundaries or it is easy to manually optimize for them.

Re:GCC 4.9.0 released by joosters on Tuesday April 22, 2014 @02:14PM (#7629338)
"Most projects don't need LTO" is just opinion (to be fair, no-one needs LTO but it may still help many people)

Larger projects could stand to gain more from LTO because the code will likely be spread across many more files. As a result, the compiler is only seeing a very small percentage of the code when it compiles each file. Potentially then, the compiler is missing out more optimisations.

Re:GCC 4.9.0 released by kzrdude on Tuesday April 22, 2014 @06:59PM (#7631029)
You could already have profiled & inlined performance critical code. With LTO, maybe you wouldn't have had to do that manually.
Re:GCC 4.9.0 released by rockdoe on Tuesday April 22, 2014 @12:17PM (#7628545)
Sounds like it's a round of optimizations, see the changelog. It's both software and a .0 release, of course there will be bugs :)
Re:GCC 4.9.0 released by awda on Tuesday April 22, 2014 @05:44PM (#7630694)
It seems more like they were doing something really dumb before to waste 11.5GB unnecessarily, but potato poh-tat-oh. I'm just happy it keeps getting better. :)
Re:GCC 4.9.0 released by kcbanner on Tuesday April 22, 2014 @10:24PM (#7631713)
I wouldn't call LTO "really dumb"
Re:GCC 4.9.0 released by awda on Wednesday April 23, 2014 @03:42PM (#7636408)
Me either. But to scrape off 80% of memory use, you had to be wasting 400% of the lower limit -- which seems dumb in retrospect.
Re:GCC 4.9.0 released by bsdetector on Tuesday April 22, 2014 @11:16AM (#7628166)
Still no D compiler huh? I've been out of the scene for a while, but I think they were they promising D support would be included a releases or two after Go support was added. What happened?
Re:GCC 4.9.0 released by sp332 on Tuesday April 22, 2014 @12:44PM (#7628721)
It seems to be in active development http://gdcproject.org/downloads/ "Merging GDC into upstream GDB" is on the list of project ideas http://wiki.dlang.org/GDC/ProjectIdeas
Re:GCC 4.9.0 released by abique on Tuesday April 22, 2014 @04:34PM (#7630253)
How is growing D? I played with it 6 years ago, then I totally forgot it.
Re:GCC 4.9.0 released by noname123 on Tuesday April 22, 2014 @04:56PM (#7630389)
OT but tangential, what do you guys use to build/make via GCC?

Makefile seems like you have to code every new addition in your build manually and take care of the dependency tree.

Eclipse CDT seems difficult to set up.

Ant doesn't seem like good C/C++ Make options and require lots of XML and extra plugins to get it work.

Scons seems like a good option. Haven't tried Maven. What do you guys use to do C/C++ builds for production or for fun?

Re:GCC 4.9.0 released by AndrewBissell on Tuesday April 22, 2014 @05:16PM (#7630506)
CMake is worth a try. Notably, it's the first build system that IntelliJ's new C/C++ IDE will support once it's released.

Although it's discouraged, CMake does have a way around the "code every new addition in your build manually" problem: http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:au...

Re:GCC 4.9.0 released by cypher543 on Tuesday April 22, 2014 @06:10PM (#7630812)
I despise CMake's syntax. But it is by far the best build system to use if you like IDEs and don't want to manage separate project files.
Re:GCC 4.9.0 released by AndrewBissell on Tuesday April 22, 2014 @06:29PM (#7630904)
Yeah I remember reading a review of CMake that asked why, with so many good scripting languages out there these days, they would hand roll their own subpar implementation. But I mostly think it's a wash between CMake and vanilla make, with its significant tabs nonsense.
Re:GCC 4.9.0 released by mitchty on Tuesday April 22, 2014 @06:02PM (#7630777)
Autotools and makefiles for me.
Re:GCC 4.9.0 released by hardlywaiting on Tuesday April 22, 2014 @05:05PM (#7630445)
CMake
Re:GCC 4.9.0 released by davexunit on Tuesday April 22, 2014 @09:43PM (#7631577)
Autotools all the way.