AP.
AP.

Reputation: 5323

tips for efficient and optimized Cocoa applications

I am developing a cocoa application (Mac) and wanted to know what are your tips, best practices, ... for an efficient Cocoa application, which starts in less than 1 second and which is very responsive. I've installed twitter for Mac and was amazed by its speed. Is it using special tricks?

Thanks in advance for your ideas :)

Upvotes: 2

Views: 227

Answers (4)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Do only what you need to do and only when you need to do it.

Upvotes: 0

seand
seand

Reputation: 5286

A lot of it may be simply tightly written, good quality code. These sort of apps don't tend to rely on clunky frameworks etc.

Upvotes: 0

Caleb
Caleb

Reputation: 124997

Three things that can help reduce startup time and improve overall performance are:

  • Defer loading resources until they're actually needed.
  • Profile your app to identify the parts that have the highest cost (whether you measure that in execution time, memory, or something else). Then work to reduce the cost of those operations or figure out a way to do them less or at a different time.
  • Take advantage of the hardware. Most machines these days have at least two processing cores and advanced graphics processors; use GCD, Quartz, Core Animation, and other technologies to take advantage of the available power.

Upvotes: 5

Tom Dalling
Tom Dalling

Reputation: 24125

I don't think there are really any "tricks" per se. You just profile your code with Instruments, and eliminate the slow areas. It's the same as optimising any code; don't block the main thread with disk reads/writes, use lazy loading where appropriate, etc.

Upvotes: 3

Related Questions