Announcement

Collapse
No announcement yet.

Slow speed of gcc compiled program under Kubuntu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Development] Slow speed of gcc compiled program under Kubuntu

    Hello,
    I faced following issue with slow speed under Kubuntu.

    I have two OS on my PC with CPU Intel i7. One OS is Kubuntu 18.04, the other OS is Windows 10 Pro 1803 running on same HDD.

    I have tested a simple program written in C language doing some number calculations.
    On Kubuntu compiled with gcc 7.2.0, on Windows compiled with older gcc 5.2.0. under mingw-w64.

    The result was amazing, running program was 5-times slower on Kubuntu, than on Windows.

    I tried on Kubuntu to compile with some CPU specific options like -corei7 etc., but nothing helped.

    Is there a reason for this slow speed under Kubuntu?

    Thank you very much for any help.
    Best Regards

    #2
    Depends on the libraries you load or which are loaded automatically. Floating point libraries are much slower than Integer libraries or BCD libraries.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      Thanks for answer. On both systems I used compilation like this: "gcc -lm", so the library "math.h" should be loaded. The source code is exactly the same on both OS. Where could the mistake?

      Comment


        #4
        Compile it with debug and then step through it using kdbg
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          You haven't mentioned the optimization level used. That leads me to suspect the compiles have been done at different levels, which would produce a difference as you report.
          Regards, John Little

          Comment

          Working...
          X