cpu usage with typing

Discussion in 'Mac Apps and Mac App Store' started by darkwing, Nov 19, 2004.

  1. darkwing macrumors 65816

    Joined:
    Jan 6, 2004
    #1
    I noticed today when doing massive code commenting in XCode (I hate that part of the project) that whenever I'd type (which is pretty fast) I would have a 25% or so jump in CPU usage. I never used to notice this before 10.3.5. I thought maybe it was just XCode's syntax coloring, but turning all that off did nothing.

    I figured it was just something XCode was doing, but it isn't. I notice the same thing in Safari. Right now as I type I'm eating a noticable amount of cpu usage. If i just bang on the keyboard it goes up more. It isn't the spell checking, as turning that off has no effect. It's as much as 30%.

    Did anyone notice this before 10.3.6?

    In case you can't tell from my other thread, I'm big on CPU usage. I work in the medical device industry, and software I write on our targets gets tested for timing down to a microsecond resolution.

    I do all my development work for x86 Linux targets on my Mac, btw. :) I can even remote cross-debug. I love OSX!

    Steve
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    I just noticed the very cool CPU usage floating graph that Activity Monitor gives you when you turn it on. Wow - Mac OS X continues to impress me more and more. Anyway, a poorly written keystroke logger will cause this behavior - but that seems unlikely to me at best. Let's see what my CPU is doing as I type this - it's gone up considerably from 4% to as high as 22% with only Safari, Finder, and Activity Monitor running and the floating horizontal CPU usage graph turned on. Quitting iTunes made the difference more noticeable. I just set a new CPU usage high of 25% while typing that last sentence. In that case, I haven't the foggiest idea what's going on.
     
  3. darkwing thread starter macrumors 65816

    Joined:
    Jan 6, 2004
    #3
    Hi wrldwzrd89. Yeah it seems to have this problem in any Cocoa text box. I have no idea why it would do that. I don't think the Mac had that problem before 10.3.6. There is no reason at all that typing a character should eat up CPU like that. Just like there is no reason sitting here with a little animated picture should eat up any CPU. Apple's graphics interface as a whole seems to be a CPU hog, which means it is inefficient. I am really disappointed. Typing in notepad on a Window's machine shows maybe 5% tops use no matter how fast you type. Macs can't even with top via sshd and show anything better than 97% idle. 3% just to sit here. Good job Apple.

    A POS PC running Linux uses <1% to idle with nothing going on.

    If they would fix these efficiency issues, it would be a "free" battery life increase for us all on laptops.

    Steve
     
  4. tamara6 macrumors regular

    Joined:
    Apr 28, 2004
    #4
    I am using 10.3.5, but I was curious if my system also used a lot of CPU while I type. So I used Safari to post a message to this thread, and I noted that my CPU was up around 22% or so. But then instead of hitting submit, I quit Safari and launched Firefox. Typing essentially the same message at the same rate in Firefox, my CPU maxed at around 17 percent or so, and was usually down around 14 percent. I have not decided if I like Firefox enough to be my regular browser, but maybe when I'm running off of a battery I should keep it in mind....
     
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    This is good - now we have 3 reports of excessive CPU usage while typing. One from darkwing, one from wrldwzrd89, and one from tamara6. We're still no closer to finding the root cause, though :confused:
     
  6. darkwing thread starter macrumors 65816

    Joined:
    Jan 6, 2004
    #6
    It seems to have the problem in any Cocoa text field, and the usage seems to be the same between programs. If I mash the keyboard as fast as I can, the usage goes up to 42%. Something as slow as keyboard input should take maybe 1% max when that happens. I don't really notice much of a difference on a Windows PC when I do that, and I sure never noticed it before. I guess it did exist in 10.3.5 according to Tamara.

    I did what Tamara just did and opened Activity Monitor to look at the numbers.

    On my Rev C 17" PB, I notice that TextEdit will max out at 33% and average 22% or so. The 22 is around what Tamara saw in Safari.

    When I had my numbers of 40-50%, my PB was unplugged and running half speed, so that might be the difference.

    I submitted a bug report to Apple. I guess we'll just have to wait.

    Steve
     
  7. cluthz macrumors 68040

    cluthz

    Joined:
    Jun 15, 2004
    Location:
    Norway
    #7
    WOW!! Tested it myself now!
    While typng fast in this (reply to topic..) text box (lots of chars, no meaning..) I jumped from 20~30% CPU usage to over 75%!!
    tried the same in gedit in x11, but the highest number i saw was 45%..
    subethaedit in osx gave up to 60%...

    There are some problems here...
    Utilizing 75% cpu when typing replies on macrumors?
     
  8. darkwing thread starter macrumors 65816

    Joined:
    Jan 6, 2004
    #8
    Yeah I just sat down at a coworker's Windows PC here at work and opened notepad. 2% max no matter how fast I type. Apple needs to get it together. Their JVM is also horribly inefficient. A simple java app on my Mac that takes 10% of the CPU on that same windows machine to scroll random lines by a window takes 100% on my mac and isn't smooth.

    I already have a problem with my top of the line 17" powerbook not being up to snuff with the new Dothans, but it's Apple's turn to one up Intel this time. However, they could at least leave me with super efficient software.

    Steve
     
  9. Manzana macrumors 6502a

    Manzana

    Joined:
    Jul 19, 2004
    Location:
    Orange County, CA
    #9
    Try it in MS Word

    So anyone try it with word? My wife is writing on our Powerbook and word is just killing it! I haven't done the "activity monitor experiment" yet but I will turn it on tonight as she works.

    You guys think more ram would help? It's a 15" 1.33 with 768MB
     
  10. PlaceofDis macrumors Core

    Joined:
    Jan 6, 2004
    #10
    welll i have quite of bit of apps open right now as i type this, including adium, finder, safari, mail, itunes, ical, word, and the activity monitor. i do notice that safari is eating up quite a bit of my cpu usage as i am typing this, but its not like itunes is having any problems playing the songs, most of the other apps are hidden in the background, but yes definately odd i must say....

    ok, i just tried typing in a chat box in adium, that spiked too, i know typing shouldnt take up any resources really, its very weird

    i wonder if this is a glitch, or something we just never noticed
     
  11. takao macrumors 68040

    takao

    Joined:
    Dec 25, 2003
    Location:
    Dornbirn (Austria)
    #11
    tried it on my windows machine
    (open in the in the background: icq,outlook express, 3 firefox windows with roughly 4 tabs each,adobe acrobat rader 5.0,NetBeans and because of that the CPU usage jumps 6-9% soemtimes


    Notepad: when typing 2%
    Word: perhaps 4-5% when typing (smashign the lots of key would be mroe accurate)
    Netbeans:goes up 10-15%
    ICQ:same like notepad
     
  12. darkwing thread starter macrumors 65816

    Joined:
    Jan 6, 2004
    #12
    fixed!

    This appears to have been fixed with the 10.3.7 update. Anyone else notice this?

    Steve
     
  13. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #13
    Okay - testing now. CPU usage when typing isn't quite as bad as it was before. I'm watching Safari's CPU usage while I type this, and it never seems to get above 11%, whereas before it sometimes hit 25%.
     
  14. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #14
    Xcode does extra processing when you type into a window - for each character. It performs syntax coloring on-the-fly and depending on what you type you may be starting a comment, a constant, variable or something else.

    There's also auto-complete and auto-indent (which has to be the dumbest thing ever).

    Overall there is a lot of processing going on for *each* character you type in Xcode.

    For what it's worth CodeWarrior (for Mac OS 9) was much faster/better in syntax coloring, opening files and compiling on the same hardware. Of course we didn't have tools to measure how much CPU typing was using back then, and the frontmost application took as much CPU as it could.
     
  15. darkwing thread starter macrumors 65816

    Joined:
    Jan 6, 2004
    #15
    Yeah I know that. That's the reason I tried it in many other programs as well. :)

    XCode is horrible actually. KDevelop is much better at what it does typing-wise. XCode should be a bit more efficient. I opened up a 16 meg header file the other day and it spun the CPU for a minute instead of just threading the coloring process.

    Overall I've lost faith that Apple puts a lot of effort into making efficient software.

    A good example is terminal. Open terminal and type "while true; do echo hi ; done"

    A CPU usage check will show terminal using 60% while bash only gets 27% on my system. (WindowServer gets the rest) On my linux PC, bash gets upwards of 55% while X and terminal fight over it. That's pathetic. Quartz isn't as fast as they make it out to be, or terminal isn't. One or the other.

    Steve
     
  16. Fredstar macrumors 6502a

    Fredstar

    Joined:
    Nov 3, 2004
    Location:
    Near London
    #16
    This issue seems to be happening in 10.3.7 with my imac G5 and typing in Firefox now i using as much as 30% cpu and Firefox, when loading pages, uses as much as 70% of cpu...
    Surely something must be wrong here?
    After seeing how well Panther ran on my old G3 ibook i concluded that Panther was a very efficient os as even a 700 mhz processor (way out of date) could run all of the ilife apps fine (slow but still) and general browsing.
    I am sure on our Dell Pentium 4 typing doesn't go above maybe 5% tops.
    anyone else still notice this significant cpu hog when typing?
    It appears in Word it is not as bad as it goes upto maybe 11% when typing fast
    Looking at the Activity monitor window (menumeter used to monitor cpu in top bar) it seems to be the Windowserver process that is to do with typing...
     

Share This Page