2

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 :)

4 Answers 4

5

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.
Sign up to request clarification or add additional context in comments.

Comments

3

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.

1 Comment

+1 for profiling your code. Make it work correctly first, then use the profiler to measure any slow areas - never just guess.
0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.