Processor usage at 50%

edited April 2012 in Help request
Since I started my little project I was concerned about it eating up my processor up to 50%. I google'd a bit and found this topic:

https://forum.orx-project.org/discussion/885

My MainClockFrequency was at 60 and VSync was on - it seemed that turning it off would help but unfortunately it did not. I checked the tutorial projects (so that I could check if it's not problem with my code) and noticed that every one of them gobbles up my processor power (I tried the VSync on/off and MainClockFrequency options). I'm running Windows XP. I tried to run my executable on my girlfriend's laptop (Windows Vista :huh:) and result is the same.

Any tips on what could be wrong?

Comments

  • edited April 2012
    Mmh, nothing comes to mind right now. If you choose to display the FPS (config: Render.ShowFPS set to true) and do not set anything for MainClockFrequency, how many FPSes do you get?

    If it's higher than 60, you should check your graphics driver configuration and see if you haven't selected: never use vsync in the options (in which case it won't let the applications decide if they can use it or not).

    Is that a problem that was already present with the version you sent me? If so, I'll check it tonight.
  • edited April 2012
    When I commented MainClockFrequency out and set VSync on, the FPS skyrocketed up to 600. Checked up my poor Intel GMA settings and VSync was turned off. Switched it back on but FPS didn't change. I guess I'll restart my PC and check again.

    Yes, I had the same problem with the version I've sent you.
  • edited April 2012
    Mmh, I wouldn't be surprised that the VSync is not correctly (if at all) implemented in the OpenGL driver for the Intel GMA. You're not the first one to report this issue, unfortunately I don't have any intel-based laptop anywhere (all the ones I have are using NVidia/AMD GPUs).

    I'll still try your code tonight and see if I get the same result as you with no VSync and using the MainClockFrequency.
  • edited May 2012
    I don't have access to my computer unfortunately, so I was unable to retrieve your project last night.

    Could you send it again to me?
  • edited May 2012
    Hi again!

    Sorry for the delay but I wanted to try it on a few different computers before reporting.

    VSync worked on all of them (all using NVidia or ATI cards) and the CPU was about 3%-8% depending on the machines.

    Using MainClockFrequency with VSync off was indeed maxing out cores (16.6% on a 6-cores, 12.5% on a 8-cores and 50% on a dual core).

    I'll look into that issue soon.
  • edited August 2012
    Hey,
    It's been a while and I left my project untouched, mainly because I found a job and been writing the text part of my MD. My question is, did anything change regarding this topic?
  • edited August 2012
    Hi and welcome back,

    I think I remember fixing something about MainClockFrequency a while ago but I can't clearly recall what... So I guess I'll try your project again and see how it behaves.

    So many things happening here, sorry for the lack of consistency in the follow up.

    Oh and congrats for having found a job. :)
  • edited August 2012
    Well, just tried here again with the latest version of orx (svn 3035) and I can't see the problem anymore.

    When using MainClockFrequency = 60, with VSync turned off, the CPU was at 4-5% (on a quad core, so 20-25% of a single core) and had a peak at 6% (30% of a single core) when I kept moving around with about 30-40 balls spawned.
  • edited August 2012
    Thanks for the info!

    It's great to see that ORX is constantly developed, watched over and fixed when it is needed. You guys are awesome :)
  • edited August 2012
    My pleasure!

    I still have your PM sitting in my inbox as I still owe you some code to show how to use parenting more efficiently but things have been crazy and I haven't found much free time, sorry about that!

    It's still on my TODO list though. :)
Sign In or Register to comment.