Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

TimP TimP
  • Why does my C program run faster on Linux than on Windows?

    W3bbo wrote:
    
    TimP wrote:
    Perhaps gcc is performing optimizations that VC++ is not. Try compiling them both with no optimizations and test the run times. If they're equivalent, then gcc is optimizing more aggressively, otherwise the culprit is elsewhere.



    Optimizations are good... but I'd never expect a 50% gain in performance with them.



    I would assume so too, but it's worth ruling out.

    I'm slightly confused by the invocation of gcc.

    gcc -m32 -O2 -fomit-frame-pointer -mtune=k8 -march=k8 mersenne.c /usr/local/lib/gmp.so

    Adding the path to gmp.so, in particular. If my understanding of the gcc documentation is accurate, it will regard gmp.so as an "in file", which would seem to imply (if gcc is not complaining) that gmp.so is being statically linked with your executable. You can test this by running ldd yourbinary. If you don't see gmp.so in the output, you're statically linking. I'm not well versed on VC++, so I don't know if your VC++ build is performing static linking or how you would check on Windows. Can anyone chime in?

    Back to the point at hand though, if this was the case you should have a fixed delay since dynamic linking resolution is done at invocation and the runtime differences would always be different by a roughly fixed amount.

  • Why does my C program run faster on Linux than on Windows?

    Perhaps gcc is performing optimizations that VC++ is not. Try compiling them both with no optimizations and test the run times. If they're equivalent, then gcc is optimizing more aggressively, otherwise the culprit is elsewhere.

  • Profilers

    gprof.

  • using a Managed DLL from an unmanaged one?

    Have you looked into Managed Extensions for C++ at all? I personally have never used it, but it seems to popular way to tie managed and unmanaged code together. The /clr option still compiles it to MSIL, but I'm not sure exactly what Maya's restrictions are.

  • C file function questions

    evildictaitor wrote:
    Unless you have good reason not to, always use the safe libraries.


    I think a good reason is that fopen_s doesn't exist in glibc and is not POSIX compliant. If you're going to lock yourself into VC++ with Microsoft CRT extensions, you might as well be using C#.

  • Looking for x86 assembly books (with a twist)

    I'm working my way through a computer science degree and despite being exposed to assembly programming, courses tend to focus on RISC architectures like MIPS. While the general ideas of assembly programming are similar across all architectures, the PC market is mostly x86 and I find myself lost in the adx, eax, ebx, movl, etc. soup.

    The twist (if you want to call it that) is that I'm not a hardcore assembly nut who thinks that "performance means using assembly" and I avoid assembly programming when I can move up the abstraction chain without significant consequences. However, reading things like Raymond Chen's blog, Understanding the Liunx Kernel, and Windows Internals makes me wish I could follow x86 better.

    So with that in mind, I'm looking for a book that explains the x86 assembly language as well as the x86 architecture in general. A list of all the instructions and what they do is not what I'm looking for. I'm curious about the whole architecture from areas such as booting to disk and other device access. I'd also prefer something that's readable as opposed to a link to the Intel or AMD hardware reference manuals. Something reasonably current would be nice. It doesn't have to cover x64 extensions, but I definitely want coverage of i386/32-bit.

  • What was the last fun, free thing you downloaded from MS?

    The PDF export plugin for Office 2007.

  • Guitar Hero III for PC not playing nicely with power saving on Vista

    I spent some time today sleuthing and it appears that when the guitar controller is unplugged, the system will power down the monitor according to the settings.

    This brings up another question. Why does the guitar disable monitor sleep? (my mouse, another USB device, does not) Is there a way to override the setting?

  • Guitar Hero III for PC not playing nicely with power saving on Vista

    I recently purchased Guitar Hero III for PC and while the game itself is fun and runs fine, the software in general is not very respectful to my settings.

    My biggest gripe is that it seemingly disables monitor sleep mode. I have my monitor sleep after five minutes and I can see the importance of disabling that for the duration of the game, but after I exit my monitor doesn't sleep anymore, what's worse is that even after reboots it still doesn't sleep. I checked the power management control panel and all my settings are intact, so GH3 is doing something more sneaky.

    A lesser, superficial gripe is that it disables cursor shadows after every exit, but at least I can fix that myself.

    To add insult to injury, GH3 complains that its "security software" cannot load and the game terminates if I try to run Sysinternals Process Monitor to see what it's sticking its hands into.

    To get back to the primary concern though, does anyone know what the game could be doing to break my power saving settings like this and if there's a way to fix it?

    Thanks!

  • What would it take?

    wkempf wrote:
    
    Moreover, a development tool doesn't make much sense as a reason to choose an OS, at least to me.


    It's the most common reason I hear among the developer crowd. Microsoft has the game planned out well. Developers refuse to try other platforms because of the perceived absolute supremacy of Visual Studio, said developers develop more Windows applications, users are less likely to switch because said programs will only run on Windows. No wonder they give them away for free. Smiley