Celestia's processor usage while in Full Screen
-
Topic authorCham
- Posts: 4324
- Joined: 14.01.2004
- Age: 60
- With us: 20 years 10 months
- Location: Montreal
Celestia's processor usage while in Full Screen
I just noticed something weird with both Celestia 1.4.2 and 1.5.0 (custom built). If I put the application in background, while in full screen mode and time stopped (with nothing special on screen), it's still using almost 100% of my processors time (dual system with OS X). Is this normal or a bug ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
Celestia does not try to optimize CPU usage when time is stopped. You might be changing the viewpoint, for example, using the mouse or keyboard. Adding all the tests so that calculations are done only when "something" changes would be quite a bit of work.
However, Celestia does no calculations when it is iconized under Windows. That's probably true under the other operating systems, too. Even this is risky, though. If you click on a Cel URL while Celestia is iconized, the view you'll see when you de-iconize it will be quite confused.
However, Celestia does no calculations when it is iconized under Windows. That's probably true under the other operating systems, too. Even this is risky, though. If you click on a Cel URL while Celestia is iconized, the view you'll see when you de-iconize it will be quite confused.
Selden
-
Topic authorCham
- Posts: 4324
- Joined: 14.01.2004
- Age: 60
- With us: 20 years 10 months
- Location: Montreal
Then why does Celestia using only 0.5 % processor time, while in windowing mode and in background, and 95% processor time if in full screen mode and in background ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
It sounds to me like the cpu% may be wrong.
What fps does Celestia claim? (and what is your screen's refresh rate?)
In general, Celestia uses 100% of the CPU unless it can finish drawing its window before the computer has to display the next screen.
In other words, if your system is refreshing the screen at 75Hz and Celestia's fps is less than 75 fps, then Celestia will use 100% of the CPU trying to keep up.
If vertical retrace sync is enabled in the graphics card and Celestia finishes computing its next display before it's time for the computer to show the next screen, then Celetia will pause while waiting for the next vertical retrace signal and it'll use less than 100% of the cpu.
If vertical retrace sync is disabled, then Celestia will use 100% of the cpu at all times, possibly creating new screens faster than the computer can.
[edit]
It could be that someone has implemented code in the Mac version of Celestia so that it stops trying to recalculate its window when the window is obscured. Certainly the Windows version of Celestia continues to use all of the CPU whether or not its window is obscured.
[/edit]
What fps does Celestia claim? (and what is your screen's refresh rate?)
In general, Celestia uses 100% of the CPU unless it can finish drawing its window before the computer has to display the next screen.
In other words, if your system is refreshing the screen at 75Hz and Celestia's fps is less than 75 fps, then Celestia will use 100% of the CPU trying to keep up.
If vertical retrace sync is enabled in the graphics card and Celestia finishes computing its next display before it's time for the computer to show the next screen, then Celetia will pause while waiting for the next vertical retrace signal and it'll use less than 100% of the cpu.
If vertical retrace sync is disabled, then Celestia will use 100% of the cpu at all times, possibly creating new screens faster than the computer can.
[edit]
It could be that someone has implemented code in the Mac version of Celestia so that it stops trying to recalculate its window when the window is obscured. Certainly the Windows version of Celestia continues to use all of the CPU whether or not its window is obscured.
[/edit]
Last edited by selden on 16.09.2006, 15:24, edited 1 time in total.
Selden
Cham wrote:Then why does Celestia using only 0.5 % processor time, while in windowing mode and in background, and 95% processor time if in full screen mode and in background ?
That's weird, I'll try and test this tomorrow. I would expect however that the OS X Celestia only stops using CPU when hidden, not when it's in the background but the window is still visible.
-
Topic authorCham
- Posts: 4324
- Joined: 14.01.2004
- Age: 60
- With us: 20 years 10 months
- Location: Montreal
I forgot to tell that in both cases, Celestia was hidden in background (not viisible). In wondow mode, its cpu usage was less than 1%, while in fullscreen mode, it was about 90% and higher.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
I tried new code, and I found another problem(I don't understand whether this bug is related of recent modifying.):
After turning into full screen mode, using Expos?©, and going back Celestia window, the display becomes black.
There is no way to put the display back in place
So I forced to reboot... I experienced this twice to do same steps!
(Sorry, I don't check the new feature yet because of this problem )
with iBook G4 12" released at July 22, 2005 and Mac OS X, 10.4.7
[edit]
I checked the low CPU usage with hidden full-screen Celestia window.
[/edit]
After turning into full screen mode, using Expos?©, and going back Celestia window, the display becomes black.
There is no way to put the display back in place
So I forced to reboot... I experienced this twice to do same steps!
(Sorry, I don't check the new feature yet because of this problem )
with iBook G4 12" released at July 22, 2005 and Mac OS X, 10.4.7
[edit]
I checked the low CPU usage with hidden full-screen Celestia window.
[/edit]
-Suι
I don't know about the maxos build but the new fullscreen mode is perfect.
it's more like a windowed mode without a window.
so now I can run celestia in fullscreen and do whatever I want on my 2nd screen in dual-screen setup
it's more like a windowed mode without a window.
so now I can run celestia in fullscreen and do whatever I want on my 2nd screen in dual-screen setup
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)
Sui Ota wrote:I tried new code, and I found another problem(I don't understand whether this bug is related of recent modifying.):
After turning into full screen mode, using Expos?©, and going back Celestia window, the display becomes black.
There is no way to put the display back in place
So I forced to reboot... I experienced this twice to do same steps!
(Sorry, I don't check the new feature yet because of this problem )
with iBook G4 12" released at July 22, 2005 and Mac OS X, 10.4.7
[edit]
I checked the low CPU usage with hidden full-screen Celestia window.
[/edit]
Thanks for the report. I've managed to duplicate the Expos?© issue. For me, if I press F9 and then click on Celestia the screen goes black although by pressing every key combination I could think of I somehow managed to quit Celestia What a harrowing experience! Maybe this should be called the Black Screen of Death(tm).
I'll check into it.
-
Topic authorCham
- Posts: 4324
- Joined: 14.01.2004
- Age: 60
- With us: 20 years 10 months
- Location: Montreal
EDIT : After several tries, while in fullscreen mode, I had the black screen of death. The issue is definitely here. I'm using Tiger 10.4.7.
I tested the fullscreen mode in background. The processors usage is now down to 4% (mean value). Much bettter, but still higher than if it's a window in background (hidden), which gives me about 0.5%, according to the process monitor.
I tested the fullscreen mode in background. The processors usage is now down to 4% (mean value). Much bettter, but still higher than if it's a window in background (hidden), which gives me about 0.5%, according to the process monitor.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
Black screen of death is now fixed in CVS.
It was caused by Celestia fading the screen to black when activated in Expose. Now it should only fade to black when switching to full screen mode. Oops.
I know the CPU usage isn't entirely eliminated in full screen mode, but a 100% effective fix looked rather messy to implement so I didn't bother. At the end of the day, does it seriously affect your work?
It was caused by Celestia fading the screen to black when activated in Expose. Now it should only fade to black when switching to full screen mode. Oops.
I know the CPU usage isn't entirely eliminated in full screen mode, but a 100% effective fix looked rather messy to implement so I didn't bother. At the end of the day, does it seriously affect your work?
-
Topic authorCham
- Posts: 4324
- Joined: 14.01.2004
- Age: 60
- With us: 20 years 10 months
- Location: Montreal
The black screen of death appears to be solved !
I tested a new built 2 min ago, using all the dashboard-expos?© tricks like crazy, and nothing bad happened !
However, I'm still wondering why stopping time, full screen mode in background (hidden) still gives 4% processors time. Okay, I'm a prefectionnist, I admit it !
Thanks for the good work, Dirkpitt !
I tested a new built 2 min ago, using all the dashboard-expos?© tricks like crazy, and nothing bad happened !
However, I'm still wondering why stopping time, full screen mode in background (hidden) still gives 4% processors time. Okay, I'm a prefectionnist, I admit it !
Thanks for the good work, Dirkpitt !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"
selden wrote:Dirk,
Is there any chance the "hidden window" CPU reduction could be provided in the Windows version of Celestia?
I'm not sure. I added event handlers for application hiding/unhiding to the OS X version but not sure if the Win32 api has such events that could be caught (and I thought Windows doesn't have a concept of "hiding", so by "hidden window" I guess you mean minimized?)
To be completely honest, even before adding the event handlers the OS X version would use only minimal CPU when not in full screen mode but hidden because of automatic OS "magic" (ie., the OS would just understand that a hidden window didn't need updating, and calculations are only set to trigger on window updates hence no CPU usage). Why this didn't work for the full screen window I still don't understand but it didn't seem worth losing sleep over.
No, I mean hiddendirkpitt wrote:selden wrote:Dirk,
Is there any chance the "hidden window" CPU reduction could be provided in the Windows version of Celestia?
I'm not sure. I added event handlers for application hiding/unhiding to the OS X version but not sure if the Win32 api has such events that could be caught (and I thought Windows doesn't have a concept of "hiding", so by "hidden window" I guess you mean minimized?)
The Windows version of Celestia already stops using CPU when its window is minimized. I don't know anything about the Windows GUI API, so I don't know if it actually provides the necessary information.
A quick Web search shows that a Windows "hidden window" is one that's never drawn by design. "Fully occluded window" may be a more appropriate term, but I can't find anything about that.
Selden
selden wrote:"Fully occluded window" may be a more appropriate term
Ah, we are talking about two different things then.
"Hiding" a window is an actual operation that can be performed from any application's menu on OS X, and results in the app's windows disappearing from view (to be precise, they are removed from the global screen list).