• g++ spent lots of user time

    From wij@totalbb.net.tw@21:1/5 to All on Wed Mar 1 06:05:44 2017
    Why did the compilation took so long in user time?

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to wij@totalbb.net.tw on Wed Mar 1 09:50:11 2017
    On Wednesday March 1 2017 09:05, in comp.os.linux.development.apps, "wij@totalbb.net.tw" <wij@totalbb.net.tw> wrote:

    [Text order altered]

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    Why did the compilation took so long in user time?

    You have not provided enough information to allow anyone to give you a comprehensive answer to your question.

    I can give you a generic answer to your question, though.

    Your compilation tool a long time because the compiler was doing lots of complicated things that didn't require any system calls.

    Process time is split into "the length of time the process waited while the OS serviced a process-initiated system call, such as open() or read()" and "the rest of the time that the process took to execute". Your "system call time"
    (or "sys") is 0 minutes, 0.099 seconds, while your "everything else time" (or "user") is 6 minutes, 8.142 seconds. That's all we can tell from the information you supplied.

    --
    Lew Pitcher
    "In Skills, We Trust"
    PGP public key available upon request

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johann Klammer@21:1/5 to wij@totalbb.net.tw on Wed Mar 1 17:18:35 2017
    On 03/01/2017 03:05 PM, wij@totalbb.net.tw wrote:
    Why did the compilation took so long in user time?

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    That's g++. especially their C++ compiler is awfully slow.
    Not sure what it is. maybe the parser... those STL headers
    with all the templates. or their garbage collector. I
    suspect it's not very good at collecting the garbage...
    Maybe it is time to look for alternatives.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From wij@totalbb.net.tw@21:1/5 to Lew Pitcher on Wed Mar 1 17:12:17 2017
    On Wednesday, March 1, 2017 at 10:50:14 PM UTC+8, Lew Pitcher wrote:
    On Wednesday March 1 2017 09:05, in comp.os.linux.development.apps, "wij@totalbb.net.tw" <wij@totalbb.net.tw> wrote:

    [Text order altered]

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    Why did the compilation took so long in user time?

    You have not provided enough information to allow anyone to give you a comprehensive answer to your question.

    I can give you a generic answer to your question, though.

    Your compilation tool a long time because the compiler was doing lots of complicated things that didn't require any system calls.

    Process time is split into "the length of time the process waited while the OS
    serviced a process-initiated system call, such as open() or read()" and "the rest of the time that the process took to execute". Your "system call time" (or "sys") is 0 minutes, 0.099 seconds, while your "everything else time" (or "user") is 6 minutes, 8.142 seconds. That's all we can tell from the information you supplied.

    --
    Lew Pitcher
    "In Skills, We Trust"
    PGP public key available upon request

    The lack of information is intentional, because it has never occurred at least 4 month before for more than 10 years, it might involve template things though. But it contains about 1500 lines, it is not shown.
    Currently, almost every object files in the Makefile takes nearly 10 more minutes to compile. So I think it should be mostly the 'feature' of newer g++

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From wij@totalbb.net.tw@21:1/5 to Johann Klammer on Wed Mar 1 17:29:27 2017
    On Thursday, March 2, 2017 at 12:03:07 AM UTC+8, Johann Klammer wrote:
    On 03/01/2017 03:05 PM, wij@totalbb.net.tw wrote:
    Why did the compilation took so long in user time?

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    That's g++. especially their C++ compiler is awfully slow.
    Not sure what it is. maybe the parser... those STL headers
    with all the templates. or their garbage collector. I
    suspect it's not very good at collecting the garbage...
    Maybe it is time to look for alternatives.

    I don't use STL, and even the standard library. But I do
    start learning another language instead following C++'s many
    new things, making codes difficult to comprehend and maintain.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to wij@totalbb.net.tw on Thu Mar 2 15:33:36 2017
    wij@totalbb.net.tw writes:
    On Wednesday, March 1, 2017 at 10:50:14 PM UTC+8, Lew Pitcher wrote:

    [...]

    -----------------
    $g++ --version
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
    ...

    $time g++ -c -Wall -pthread -fPIC dsmain.cpp

    real 6m10.623s
    user 6m8.142s
    sys 0m0.099s

    Why did the compilation took so long in user time?

    [...]

    Your compilation tool a long time because the compiler was doing lots of
    complicated things that didn't require any system calls.

    [...]

    Currently, almost every object files in the Makefile takes nearly 10 more minutes to compile. So I think it should be mostly the 'feature' of newer g++

    This strongly suggests that you're keeping the compiler busy with doing
    and re-doing loads of avoidable things. Considering that this is C++,
    that's almost certainly template-related.

    It should be possible to detemine the exact cause using #if 0
    ... #endif to neutralize all of the code in this file and than
    re-activate it bit by bit until the problematic part has been found.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)