Re: Cocoa and Computational Expense

2009-06-20 Thread Justin Carlson
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? Hi Kevin, I recommend running Shark for tasks really want to inspect. It i

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
From: Chris Williams > In 25 years in the computer business, I've seen precisely one example of > someone successfully re-coding around performance issues with the language > or library. And that was only because they coded a tiny snippet of > assembler that managed to fit into the pre-fe

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Ben Trumbull, Thank you for sharing your experiences on the subject in extent! Regards, Justin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at c

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 8:23 PM, Bill Bumgarner wrote: On Jan 18, 2009, at 6:05 PM, Justin Carlson wrote: I have also seen (unspecified) system libraries worsen considerably over time - 'faster over the course of OS releases' is not as sunny as I once believed. Believing system libr

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 7:36 PM, Greg Titus wrote: On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: Jean-Daniel Dupas wrote: > > Each time you use KVC/KVO. Hi Jean-Daniel, Sorry if I misreading this, your response was short - it could mean a few things. I am inclined to think yo

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 7:20 PM, mmalc Crawford wrote: On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: I would generally write: - (void)setMovie:(MyMovie *)newMovie { // make sure it is ok here In general your accessors should not perform validation; instead you should implement the

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
>I've been watching this discussion w/great interest. Thanks. > > A lot of the discussion seems to be focused on micro-optimizations and little focused on systemic optimizations. > > One point that I have yet to see mentioned is the overall performance enhancements to be had by focusi

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Jean-Daniel Dupas wrote: > > An additional problem is that it does not scale well. Programs mature, > > objects are used beyond their initial intent, programmers come and go > > and that source becomes a nightmare to maintain. Getting back to good > > OO style, why take the messaging overh

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Quincey Morris wrote: > TBH (and more to the point) I strongly suspect it's true of everyone who's > expressed an opinion in this thread that it's not so much about the > suitability of the language to optimizations, but more about the skill > set of the individual with regard to the langu

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
John Engelhart wrote: > On Sat, Jan 17, 2009 at 7:44 PM, Scott Ribe wrote: > >> TBH (and more to the point) I strongly suspect it's true of everyone > >> who's expressed an opinion in this thread that it's not so much about > >> the suitability of the language to optimizations, but more abou

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Michael Ash wrote: > > I would (personally) rather avoid caching selectors and debugging/ maintaining a > > program that used that behaviour when a well tested alternatives are built > > into another language's model. > > I agree that it's ugly, but it's good to have the option. Agreed. > M

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Justin Carlson
Michael Ash wrote: Note that dispatch is not mandatory in ObjC either. It is possible (you get little help from the compiler, but it's not hard) to use either a vtable approach or a straight function call for method invocation, as long as you don't mind the loss in functionality that this implie

re: ObjC in time-critical parts of the code

2009-01-16 Thread Justin Carlson
Note no one that responded to Jens is stating that the Objective-C way of doing message dispatching cannot cause performance critical pathways to be "hotter" then desired compared to direct function calls, C++ vtable dispatching, etc. The point has been that just don't assume that is the source of

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Justin Carlson
Sorry if I come across as the devil's advocate on this one - I think there should be another voice stating that objc use can slow a program. Compared to C or C++, Objective C is a poor choice for performance critical code. Within performance critical zones, I will only use objc objects fo

re: Declaring multidimensional arrays in obj-c

2008-09-02 Thread Justin Carlson
Hello all, I'm having a devil of a time trying to figure out what seems to be a pretty basic scenario: declaring a multidimensional array in the interface section of a class when the array dimensions are unknown until runtime. Can anyone point me in the right direction with this one? Hi Don,