Thread: g++ is very slow when compared to cl

  1. #31
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by mike_g View Post
    Surely 512mb RAM is plenty.

    Manav: maybe theres somethin eating up all your resources, either that or you have a very old pc.

    My laptop specs are:
    512mb ram.
    Celeron underclocked @ 630mhz
    280mhz bus.
    No GPU: leeches off ram instead.
    OS: Xubuntu

    But g++ will still compile pretty much any small project for me in less time than is noticable.
    But we have already established that gcc for Linux is much faster than gcc on Windows, so comparing your Linux machine to a Windows system is unfair.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #32
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Well, doesn't matter anyway... 512 MB or 512 TB... Heh.
    But I do find it a little stretch to say it's plenty. Enough perhaps. But not plenty.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #33
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Mario F. View Post
    LOL. We had this discussion before Elysia. Let it go. I think you were proved wrong back then. It's a matter of what you do with your computer. 512MB Ram can be plenty, yes. It IS plenty on my case. I honestly don't feel at all the need to put in some more.
    I agree with that - having more memory in the machine than what you can actually use makes no sense at all.

    But 512MB is not "much" in todays terms - which was my original point. The processor in manav's system is fast enough [assuming it's not also busy doing something else, so that's not the source of slow compiles]. Antivirus software and/or lack of memory comes up next on the list.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #34
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by matsp View Post
    But 512MB is not "much" in todays terms - which was my original point. The processor in manav's system is fast enough [assuming it's not also busy doing something else, so that's not the source of slow compiles]. Antivirus software and/or lack of memory comes up next on the list.
    Absolutely. My answer to Elysia was however a generalization, since that is how it was put by her. And in general terms it simply depends on what one does with their computer and what OS & software is installed.

    Make no mistake, my wxWidgets project will eventually grow enough my current system is no longer able to be so productive, even on Linux. At that time 512MB will no longer be plenty, but... not enough anymore.

    However, what I always experienced all my life is that before I felt the need to upgrade memory, I always felt the need to upgrade the whole damn computer
    anyways. I feel that processors are in more demand as far as upgrades are concerned than memory.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #35
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's funny. The processor is the least I've felt needing upgrading.
    Still using my old Athlon64 X2 3800+. It's done good work so far.
    Eventually, I'll get quad core, but then the whole mainboard needs to go out the window.
    Even graphics card are more plenty upgraded than the processor...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #36
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    When I had 512 MB of memory, I could never finish compiling the Fox Toolkit using the MinGW port of g++ 3.4.2 on MSYS. I added another 512 MB of memory and could compile without problems.

    I suspect that one will get the most out of a memory upgrade by upping it to 1 GB to 2 GB. Beyond 2 GB the law of diminishing returns may set in, and upgrading the processor and motherboard could be more effective.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #37
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by laserlight View Post
    That is definitely unusual. What are your system specs, and what version of g++ are you running?
    It's sad but true... iostream seems to be a very heavy header these days.

    I am also disappointed at how much code the standard library drags in when you try to do even very simple stuff. A statically linked "hello world" on my system is about 400k. A link dependency map shows that it all traces back to internal calls to vsprintf(), which amazingly, causes memory to be allocated with malloc(), which drags in other runtime components, which drag in yet more... Until you're at 400 kilobytes.

  8. #38
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I find that another reason to use redistribute runtime instead of static. So long as the runtime will function correctly, that is, when installed in the system folder (not messing up other programs).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #39
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    I find that another reason to use redistribute runtime instead of static. So long as the runtime will function correctly, that is, when installed in the system folder (not messing up other programs).
    Do you know how much I wish we could distribute our products in dynamic form? We do on Windows, but our Linux customers have such a variety of old glibc versions that dynamic linking just isn't an option. I wish the glibc designers were not so nonchalant about binary-breaking changes. "Oh, the user can just recompile..." Yeah right.

  10. #40
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I feel hatred towards library designers expressing themselves through a heated post
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #41
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    I feel hatred towards library designers expressing themselves through a heated post
    Okay, it took me a while to parse that. I thought you mean that you, personally, felt hatred toward library designers, designers who express themselves through heated posts.

    But what you mean is, You feel, that somebody (me) has hatred for library designers, and that person (me) is expressing himself in a heated post. Right?

    I guess you're not far from the mark. "Hatred" is a strong word though

  12. #42
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Maybe hatred is a bad word...
    I meant, frustration
    Yep, you feel frustration for library designers...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #43
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yep, you feel frustration for library designers...
    Stroustrup claims that it is not the library designers fault, but the library implementors fault.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  14. #44
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by laserlight View Post
    Stroustrup claims that it is not the library designers fault, but the library implementors fault.
    Well, I wasn't griping about the executable size (large size is expected when linking statically), but the fact that they almost deliberately go out of their way to make it impossible to link dynamically if you actually want to target a wide variety of systems.

    It's understandable (GNU is all about free software after all, and doesn't really care too much about the problems of commercial closed source vendors) but annoying.

  15. #45
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I think Elysia meant that. It's still annoying though because you might as well ask your grocery store owner to better implement libraries. His "uh" and "whatcha talking about?" will be more than the almost guaranteed lack of response from a library implementor.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CL and C++
    By siavoshkc in forum C++ Programming
    Replies: 1
    Last Post: 09-24-2006, 03:01 PM
  2. Program is slow. Help
    By jjj93421 in forum C++ Programming
    Replies: 14
    Last Post: 08-08-2004, 07:39 AM
  3. slow game
    By lambs4 in forum Game Programming
    Replies: 2
    Last Post: 08-21-2003, 02:08 PM
  4. Solutions for slow performance?
    By Hunter2 in forum Game Programming
    Replies: 52
    Last Post: 08-24-2002, 10:04 AM
  5. slow load of Cprog.com
    By Generator in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-13-2001, 06:31 AM