Announcement

Collapse
No announcement yet.

Parallelizing GCC's Internals Continues To Be Worked On & Showing Promising Potential

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    I agree. I should have excluded auto-generated source code from my comment.

    Comment


    • #32
      Originally posted by flashmozzg View Post
      And lld is even faster still.
      New technologies always require time to become widespread. I am using gcc 8.3 at the moment which does not support -fuse-ld=lld, will evaluate lld when I switch to gcc 9.2+ which does support lld.

      Comment


      • #33
        I very much like the idea of a faster linker. Building with GTK is fine, but linking takes ages (I joke, I was once familiar with clean builds taking overnight with the crew I managed).

        Comment


        • #34
          This is off-topic, however, it strikes me that Summer of Code projects might be better directed toward cleaning up poorly written code rather than speeding things up. Sure a project to speed things up has a measurable impact but cleaning up poorly written code would teach someone much more. Inculcating respect for Niklaus Wirth, Donald Knuth and Edsger Dijkstra might lead to a much higher level of competence.

          Comment


          • #35
            Originally posted by pal666 View Post
            it is irrelevant for subj. includes are processed by fronted, subj is about optimizations in middle end. even with c++20 modules compiler will skip parsing sources, but will still have to do optimizations. and (surprise) optimizations are taking more time than parsing
            Except that some C++ header files tend to be quite large because bodies of templates have to be in .h files and cannot be in .cc files. In such cases the .cc file corresponding to the header file is basically empty. Quite a lot of template code optimizations are redundant and can be optimized away.

            Take a look at this 4K (4077 bytes) ZX Spectrum demo for inspiration about how far software optimization can be pushed:

            Comment


            • #36
              Originally posted by pal666 View Post
              gcc was in multi-core world with parallel invocations. multithreading compiler isn't easy and isn't as efficient (you can see, they never got 4x spedup on 4 threads). it's nice it is being done, but you are acting like it's last compiler to do it
              You read way too much into that quoted part and the context of the rest of the post shows you that I see it as a general problem, not just GCC, that software that could need the ressources we already have available today, doesn't make use of it due to lack of developer effort. And the example of GCC shows that a GSoC student can achieve these speed ups - there was no need of a Ninja programmer apparently. Hence if a concentrated effort had been made earlier, they could have unlocked these benefits way sooner. The same goes for other software, e.g. with video rendering and other areas where parallelism and vectorization could be used better even today, e.g. there is ISPC out there to make use of both in an easier and more portable way than intrinsics or assembly.

              Comment


              • #37
                With the recent rise in computer science classes across all grades, we’re starting to grow our personal vocabularies in ways that make the average person uncomfortable. To complicate matters, many of these “new” words seem to have such intimidating histories that we don’t take the time to properly understand their usage — instead, we repeat them blindly, whether we know what they really mean or not.

                One such example of complex wordsmithing is the synonymous use of the terms “coding” and “programming”.

                Here you can read it more on it: https://www.goodcore.co.uk/blog/coding-vs-programming/

                Comment


                • #38
                  Originally posted by atomsymbol View Post
                  Except that some C++ header files tend to be quite large because bodies of templates have to be in .h files and cannot be in .cc files. In such cases the .cc file corresponding to the header file is basically empty. Quite a lot of template code optimizations are redundant and can be optimized away.
                  There are some good tricks that do let you put the template body in a cc or tcc or whatever you want to call it.

                  In the .h file declare the templates, but don't give any implementation details. Then for the types you know you will be using declare extern template specializations.

                  Then in a cpp file in your project include the actual template implementation from the tcc and define the template specializations.

                  That builds one single copy of the templates and links it.

                  And if you do need to use it with unknown types you can include the tcc and live with the extra compile time.

                  Comment


                  • #39
                    Originally posted by Zan Lynx View Post

                    There are some good tricks that do let you put the template body in a cc or tcc or whatever you want to call it.

                    In the .h file declare the templates, but don't give any implementation details. Then for the types you know you will be using declare extern template specializations.

                    Then in a cpp file in your project include the actual template implementation from the tcc and define the template specializations.

                    That builds one single copy of the templates and links it.

                    And if you do need to use it with unknown types you can include the tcc and live with the extra compile time.
                    Yes, but the programmer would need to enable LTO compilation in order to maintain runtime performance if using an optimization level that enables inlining, which will negatively affect compilation time during software development compared to non-LTO. All optimization levels, except -O0 and -Og, have inlining enabled (I am not sure about -Og).

                    There is also the issue of manual removal of template specializations that are no longer in use. The maintenance cost of template specializations of basic datatypes like lists/vectors, sets and maps is high.

                    Comment


                    • #40
                      Originally posted by ms178 View Post
                      And the example of GCC shows that a GSoC student can achieve these speed ups
                      speedup achieved was 1.09 and it still doesn't pass testsuite
                      Originally posted by ms178 View Post
                      Hence if a concentrated effort had been made earlier, they could have unlocked these benefits way sooner.
                      at the cost of some other benefits which they are developing instead, like just faster compilation on one thread. and benefits are not enough to replace parallel invocation, they can only augment it with future work

                      Comment

                      Working...
                      X