This topic contains 15 replies, has 0 voices, and was last updated by  Chomsky 13 years, 8 months ago.

  • Author
    Posts
  • #2431

    Chomsky
    Participant

    This is regarding the version of scorched3d currently in CVS.

    I’m experiencing 100% cpu utilization from the scorched3d main menu (wxGTK). I think this may have also been the case in version 36.2 and before.. but I think that before the main menu window was destroyed before entering the game. Now, I believe the menu is staying open while in the game. I think this is sapping CPU time from the game – at least it seems more sluggish.

    I’m wondering if other unix-based OS installations are experiencing this high cpu utilization from the main menu?
    Surely it has to be busywaiting, since it’s just a menu waiting for input, and isn’t doing any huge calculations.

    My fear is that this is simply a wxgtk bug…

    Device, what’s your experience on freeBSD?

    C. Thomas

    #10794

    imported_gcamp
    Participant

    I am not seeing this under Solaris. I will check under linux in a mo.
    Are you seeing this when running a server as well?

    #10795

    imported_gcamp
    Participant

    Just checked on Linux (redhat 9) and it seems to be ok.

    #10796

    GoochRules
    Participant

    On Mac OS X 10.3.2 (wxgtk 2.4.2.4-22) I am also experiencing this 100% cpu utilization.

    In fact, if i run scorched in a window (not full screen, that is), and then close the main menu window, performance (fps) increases 3x. When the main menu was still active, it and the game shared cpu usage 50/50 (actually, 40/40… Activity Viewer took up 10%, with the other 10% going to all my other processes).

    …I was wondering how you got those 100+ fsp gcamp… i’ve been lucky to squeak out a consistent 15.

    #10797

    GoochRules
    Participant

    Upon further investigation, it appears that ioctl() and select() are the culprits here, although they are probably just the henchmen, the ringleader is not quick to show his face.

    I tried to run scorched3d through the various performance tools bundled with Xcode. The only tool that gave an output meaningful to me was ‘Spin Control’, which shows you where currently running process are spending time in the system.

    Without giving any input, over 60 seconds, ./scorched3d spends 20.30 sec in ioctl() (36.0%), and 11.38 sec in select (20.0%). Also of interest is 5.50 sec in _XEventsQueued (9.0 %), and 0.84 sec in wxPoll (1.0%). wxPoll may be the root cause, as it appears to be the untimate caller of select. _XEventsQueued appears to be the parent of ioctl. wxPoll and _XEvents Queued appear to be on seperate threads, though I could be wrong here. XPending appears the be the single parent of _XEventsQueued.

    If you need more info, I can give you a complete stack trace.

    #10798

    imported_gcamp
    Participant

    Just a small note to say I am looking at this, not ignoring you 🙂
    A stack trace would be good, thanks.

    I have just checked fedora core 1 and it does not have the problem either. Is it just mac os?

    …I was wondering how you got those 100+ fsp gcamp… i’ve been lucky to squeak out a consistent 15.

    I think my geForce 4 is to thank for that :), err and my well optimized code of course 😉

    #10799

    Deathstryker
    Participant

    I think my geForce 4 is to thank for that , err and my well optimized code of course

    I’m glad I have the same vid card as you. I’m less likely to run into graphical errors. 😆

    #10800

    GoochRules
    Participant

    Just a small note to say I am looking at this, not ignoring you
    A stack trace would be good, thanks.

    I figured as much. I’ll email you the trace ASAP. I’ll also see about creating an Xcode project for this and see what I can find out… any pointers/caveats I should be aware of from your expierence with MSVC?

    I have just checked fedora core 1 and it does not have the problem either. Is it just mac os?

    It looks like it. I’ve been dying to try scorched3d out on OpenBSD 3.4. I just got that machine running last weekend, and am in the process of configuring & updating it, which takes a while over a modem. I’ll let you know whether or not I see this bug there.

    …I was wondering how you got those 100+ fsp gcamp… i’ve been lucky to squeak out a consistent 15.

    I think my geForce 4 is to thank for that , err and my well optimized code of course

    hmm…. i guess I’ll have to kick the wife off the windows machine for an evening… what sort of cpu do you have?

    #10801

    imported_gcamp
    Participant

    Just a small note to say I am looking at this, not ignoring you
    A stack trace would be good, thanks.

    I figured as much. I’ll email you the trace ASAP. I’ll also see about creating an Xcode project for this and see what I can find out… any pointers/caveats I should be aware of from your expierence with MSVC?

    Cool, got the trace. I may have an answer (or perhaps not) 🙂
    Could you try re-compiling wxWindows with no thread support.
    I think running configure with the –enable-threads=no command
    e.g.
    ./configure –enable-threads=no
    Then recompiling etc…

    …I was wondering how you got those 100+ fsp gcamp… i’ve been lucky to squeak out a consistent 15.

    I think my geForce 4 is to thank for that , err and my well optimized code of course

    hmm…. i guess I’ll have to kick the wife off the windows machine for an evening… what sort of cpu do you have?

    Scorched causes domestic upset, I can see the headlines now 🙂

    #10802

    GoochRules
    Participant

    Cool, got the trace. I may have an answer (or perhaps not)
    Could you try re-compiling wxWindows with no thread support.
    I think running configure with the –enable-threads=no command
    e.g.
    ./configure –enable-threads=no
    Then recompiling etc…

    ok… since wxgtk comes from fink, I had to add ‘–enable-threads=no’ to the wxgtk.info file, as this is the only way I know to set custom configure options on fink packages… in general I’d rather not do this (btw, I don’t think the wxgtk.* files in the osx directory are necessary anymore), but I’m willing to make exceptions in the name of QA.

    so… after a ‘fink rebuild wxgtk’ and ‘make’ + ‘make install’ on scorched, everything appears to be running a lot better, almost if not exactly as good as when closing the main menu real quick before the game goes full screen (I did have Spin Control, Activity Monitor and iTunes running).

    I hope you can get things to work fine w/o having to disable wxgtk threads.

    #10803

    imported_gcamp
    Participant

    It looks like wxGtk bug in the mac version. The only way I think I could hack round it is to put a sleep into the wx idle loop but that really sucks.

    I can add an option to close the main window on choosing an option, but other than that I think we need to either use the no threads option or get wx windows fixed :(.

    #10804

    Chomsky
    Participant

    … a guy walks into a doctor’s office and jiggles his elbow in a figure eight.. “Doc, it hurts when I do this”. “So don’t do that”, says the doctor.

    Thanks gavin and gooch.

    I’ll create wxgtk libs with no threads. (possible that this is a pthreads bug?)

    I’ve tried to contact the wxWindows guys about the earlier bug and nobody ever emailed me back… they don’t seem very open to feedback. But we have a workaround, and that’s good enough for right now..

    c. thomas

    @gcamp wrote:

    It looks like wxGtk bug in the mac version. The only way I think I could hack round it is to put a sleep into the wx idle loop but that really sucks.

    I can add an option to close the main window on choosing an option, but other than that I think we need to either use the no threads option or get wx windows fixed :(.

    #10805

    Chomsky
    Participant

    @goochrules! wrote:

    in general I’d rather not do this (btw, I don’t think the wxgtk.* files in the osx directory are necessary anymore), but I’m willing to make exceptions in the name of QA.

    I hope you can get things to work fine w/o having to disable wxgtk threads.

    The wxgtk.* files are still necessary…

    Try to compile scorched without patched wxgtk and it will fail…. The bug hasn’t ever been fixed, and I’m unsure if it ever will be.

    Of course, most OSX users of scorched will never need to know about this stuff, since I’m supplying libs with the scorched package nowadays.

    BTW, thankee for responding and helping out, gooch.

    #10806

    GoochRules
    Participant

    The wxgtk.* files are still necessary…

    Try to compile scorched without patched wxgtk and it will fail…. The bug hasn’t ever been fixed, and I’m unsure if it ever will be.

    uh… I did… and indeed it does work. When was the last time you tried to build scorched3d against the latest wxgtk from fink? the Version: line in scorched/osx/wxgtk.info is 2.4.1.2, whereas the latest from fink is 2.4.2.4. The two patch files are idententical.

    Of course, most OSX users of scorched will never need to know about this stuff, since I’m supplying libs with the scorched package nowadays.

    Its a real shame I never fall into these sorts of categories. I’d say I’d try harder, but that would be a lie.

    BTW, thankee for responding and helping out, gooch.

    I have but one regret, that I have but one life to give my scorched3d.

    ..I’ll try to remove my tongue from my cheek now.

    #10807

    Chomsky
    Participant

    Do you mean to say that fink is supplying my patch in the distribution for wxgtk now? OH HAPPY DAY!

    I really hoped they would, but I never got email back..

    @goochrules! wrote:

    uh… I did… and indeed it does work. When was the last time you tried to build scorched3d against the latest wxgtk from fink? the Version: line in scorched/osx/wxgtk.info is 2.4.1.2, whereas the latest from fink is 2.4.2.4. The two patch files are idententical.

    I have but one regret, that I have but one life to give my scorched3d.

    ..I’ll try to remove my tongue from my cheek now.

    Ahhh man… I was so proud that I felt a tear welling up, and then you destroyed the moment with your cynicism!

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.