Cocoa and Computational Expense
Cocoa and Computational Expense
- Subject: Cocoa and Computational Expense
- From: syntonica <email@hidden>
- Date: Sat, 20 Jun 2009 16:36:58 -0700 (PDT)
Hello All--
I am new to Cocoa (about 3 weeks now) and have not done much programming since the halcyon days of 16K RAM. Finishing up the main body of my program, I looked at what I have done and shivered. I have implemented a delegate method for "textDidChange" to handle a few things, including live updating the same field on a NSTableView. Now, according to my informal measurements (watching the CPU meter while typing furiously), my program eats up to 30% of the 1GHz G4 CPU! That seems a little extreme just to type a few words.
My questions are:
How can I tell how computationally expensive a class or method is? I've never been this far from the metal. Is there a corpus somewhere listing this, or do programmers just know these things from their experience?
In the old days, we would cut corners and break rules to get better performance or memory usage. The idea of "more" meant thousands of dollars more. Now, resources for your average little application seem to be limitless. So, do I just walk the straight and narrow and let the Frameworks worry about these things for me?
Finally, on a side note and because this is my first OOP, just how big should a class get? Just as a rule of thumb. I have 700 lines and 50 methods in my MyDocument class and it seems positively bloated to me. Is this normal? Or might I possibly have a bad design? I only see a couple of lines that could be factored into their own method and nothing that could really me moved into its own class.
I know these are rather vague questions with amorphous answers, but I am hoping somebody can shine some light or at least show me which door I need to go through.
Thanks in advance to any and all who are able to reply.
Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden