Is garbage collection used in production quality Cocoa apps?

后端 未结 5 1657
有刺的猬
有刺的猬 2021-02-06 09:34

I\'m mainly wondering about the affect that garbage collection would have on performance. Is the use of garbage collection frowned upon for release apps?

Another concern

5条回答
  •  庸人自扰
    2021-02-06 09:54

    Like the others, I would strongly recommend using GC. The performance overhead usually is negligible! I don't need to repeat the benefits as stated by other users.

    However, I would strongly encourage writing libraries, as opposed to applications, to run in a non-GC mode as well. Some environments cannot run GC code, the iPhone being the notable one; so if you created an internal library for yourself, that you envision reusing it later for an iPhone app, then I would recommend designing it so it would work in a non-GC environment as well.

    Converting a GC code to non-GC code is much more difficult than the other way around!

提交回复
热议问题