Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Why are Expander and Explorer eating CPU time in the background?

Why are Expander and Explorer eating CPU time in the background?
Thread Tools
Colonel Panick
Fresh-Faced Recruit
Join Date: Jun 2001
Location: Belgium
Status: Offline
Reply With Quote
Jun 13, 2001, 12:00 PM
 
Most apps usu 0.0% CPU time when inactive in the background, as reported by top. Except Stuffit Expander en Internet Explorer. They constantly eat 0.5% to 1% CPU time. Why? Bad carbonisation?
*** Col. Panick with [ck] that's me.
     
Developer
Addicted to MacNN
Join Date: Apr 2001
Location: europe
Status: Offline
Reply With Quote
Jun 13, 2001, 12:36 PM
 
They are probably calling WaitNextEvent() with a too small sleep time. WaitNextEvent() returns control to the calling application whenever an event has occurred or after the specified sleep time (to allow the handling of periodic task such as continuing downloading a web page or decompressing a file at idle time).
They wouldn't have to switch to carbon events completely (would probably be a major task for Internet Explorer), just pass a very large sleep time (MAXINT) to WaitNextEvent() and install Carbon Event Timers for periodic tasks (as needed).


Developer
Nasrudin sat on a river bank when someone shouted to him from the opposite side: "Hey! how do I get across?" "You are across!" Nasrudin shouted back.
     
malvolio
Professional Poster
Join Date: Apr 2001
Location: Capital city of the Empire State.
Status: Offline
Reply With Quote
Jun 14, 2001, 10:12 AM
 
Sounds like a polite way of saying they were poorly written.
/mal
"I sentence you to be hanged by the neck until you cheer up."
MacBook Pro 15" w/ Mac OS 10.8.2, iPhone 4S & iPad 4th-gen. w/ iOS 6.1.2
     
Colonel Panick  (op)
Fresh-Faced Recruit
Join Date: Jun 2001
Location: Belgium
Status: Offline
Reply With Quote
Jun 17, 2001, 06:53 PM
 
malvolio: i still prefer the first answer, though.

I also feel that a high cpu load is not really what makes processes run slower. Swapping Virtual Memory and paging is way worse. OS X also seems to put a high strain on the video board.
*** Col. Panick with [ck] that's me.
     
Rickster
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Jun 17, 2001, 06:54 PM
 
Poorly written? Sort of, perhaps. I'd classify it as "quickly ported". WaitNextEvent() and friends are sort of the basis for the run-loop architecture of Classic Mac OS apps. Since every app on that system gets full control of the processor when it wants to, that architecture works well there.

However, on a modern core OS, it kills performance to be demanding CPU time every few milliseconds just to ask "did something happen?". Instead, its best to use the Carbon Event architecture to let the system tell you when things happen.

At WWDC they put a lot of emphasis on the fact that Mac OS X has very different performance characteristics from Mac OS 9. You can get a Carbon app up and running on X pretty quickly, but if you stop there, your app will suck.
Rick Roe
icons.cx | weblog
     
frawgz
Mac Enthusiast
Join Date: Dec 2000
Location: Los Angeles, CA
Status: Offline
Reply With Quote
Jun 17, 2001, 07:41 PM
 
We were just learning about polling vs. interrupts in our CS class last quarter - am I right in assuming that WaitNextEvent and Carbon Events are direct analogs of these concepts in action?
     
giantmike
Mac Enthusiast
Join Date: May 1999
Location: Green Bay, WI USA
Status: Offline
Reply With Quote
Jun 18, 2001, 08:27 PM
 
You think that's bad? Launch AIM, and watch its CPU usage while in the background (normally around 30-60%)
Giantmike's Website - Version 5.0
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 02:43 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,