c*********e 发帖数: 16335 | 1 objective-c有arc来自动release,和jave的gc一样,怎么就没有java那么明显的慢呢?
这个在用iphone和android时比较一下就可以发现,iphone非常的连贯,android就没有
那么连贯。什么原因?2个都有garbage collection啊。 |
c*******9 发帖数: 9032 | 2 GC of java is Runtime, while ARC is compile time.
【在 c*********e 的大作中提到】 : objective-c有arc来自动release,和jave的gc一样,怎么就没有java那么明显的慢呢? : 这个在用iphone和android时比较一下就可以发现,iphone非常的连贯,android就没有 : 那么连贯。什么原因?2个都有garbage collection啊。
|
c*********e 发帖数: 16335 | 3 java怎么不搞个compile time的?
【在 c*******9 的大作中提到】 : GC of java is Runtime, while ARC is compile time.
|
c*******9 发帖数: 9032 | 4 跨平台。
【在 c*********e 的大作中提到】 : java怎么不搞个compile time的?
|
c*********e 发帖数: 16335 | 5 orz
bill gates的c#,也可以搞arc了。 看来steve jobs, bill gates思路还是一样的。
【在 c*******9 的大作中提到】 : 跨平台。
|
c*******9 发帖数: 9032 | 6 虚拟机上的debug还是容易些。
【在 c*********e 的大作中提到】 : orz : bill gates的c#,也可以搞arc了。 看来steve jobs, bill gates思路还是一样的。
|
c*********e 发帖数: 16335 | 7 xcode里面debug也还行啊。
【在 c*******9 的大作中提到】 : 虚拟机上的debug还是容易些。
|
f*******n 发帖数: 12623 | 8 reference counting无法对付cycle。只能靠程序员自己设计怎么正确地用weak
reference来防止cycle。如果用错了就会导致memory leak或object用到一半消失。
Blocks(就是Apple的anonymous function)很容易不小心会产生cycle。用weak
reference很麻烦、弄到编码更复杂;很多人都不懂怎么正确用。
还有,reference counting增减count的时候需要lock,否则就不thread-safe。但是
lock是很慢的。 |
l*********s 发帖数: 5409 | 9 out goes objc, in comes swift |
c*********e 发帖数: 16335 | 10 swift就是objective-c上加了一层皮,编译的时候,swift先编译成objective-c,再继
续。这个swift也太搞了。
【在 l*********s 的大作中提到】 : out goes objc, in comes swift
|
|
|
c*********e 发帖数: 16335 | 11 那为什么的iphone的用户体验明显比android的好呢?
【在 f*******n 的大作中提到】 : reference counting无法对付cycle。只能靠程序员自己设计怎么正确地用weak : reference来防止cycle。如果用错了就会导致memory leak或object用到一半消失。 : Blocks(就是Apple的anonymous function)很容易不小心会产生cycle。用weak : reference很麻烦、弄到编码更复杂;很多人都不懂怎么正确用。 : 还有,reference counting增减count的时候需要lock,否则就不thread-safe。但是 : lock是很慢的。
|
c*********e 发帖数: 16335 | 12 java运行的时候是在jre里面跑,又不是在linux,windows里跑。java搞个compile time
的gc,编译的时候把释放内存写在code里,没什么不行的啊。
【在 c*******9 的大作中提到】 : 跨平台。
|
l*********s 发帖数: 5409 | 13 you are right, it has nothing to do with cross-platform, but rather a
language choice between performance and being easy.
time
【在 c*********e 的大作中提到】 : java运行的时候是在jre里面跑,又不是在linux,windows里跑。java搞个compile time : 的gc,编译的时候把释放内存写在code里,没什么不行的啊。
|
l*********s 发帖数: 5409 | 14 fast food 比 fine dining 难吃很奇怪么。
【在 c*********e 的大作中提到】 : 那为什么的iphone的用户体验明显比android的好呢?
|
ET 发帖数: 10701 | 15 ARC is not garbage collection.
this stackoverflow explains better:
http://stackoverflow.com/questions/6385212/how-does-the-new-aut
【在 c*********e 的大作中提到】 : objective-c有arc来自动release,和jave的gc一样,怎么就没有java那么明显的慢呢? : 这个在用iphone和android时比较一下就可以发现,iphone非常的连贯,android就没有 : 那么连贯。什么原因?2个都有garbage collection啊。
|
ET 发帖数: 10701 | 16 here is an explanation from an old article.
http://www.imore.com/android-ui-smooth-ios
【在 c*********e 的大作中提到】 : 那为什么的iphone的用户体验明显比android的好呢?
|
c*******9 发帖数: 9032 | 17 并不完全是这样吧。有的东西没有objc对应。
【在 c*********e 的大作中提到】 : swift就是objective-c上加了一层皮,编译的时候,swift先编译成objective-c,再继 : 续。这个swift也太搞了。
|
g*****g 发帖数: 34805 | 18 No, that's from an intern that knows nothing and it's been refuted to death.
The No.1 reason is Android allows more control for apps and users. e.g. It
doesn't limit much on what you can do as a background service, so you can
poll and drain the battery if you like. iOS on the other hand, put much
restriction there. For a long time no app other than selective few stock
apps are allowed running concurrently. The downside is that your state may
not be reserved once you switched back to an app.
Overall it's freedom vs. control. My Android device would run as fluidly as
day 1 after 2 years but an average Joe's may not.
【在 ET 的大作中提到】 : here is an explanation from an old article. : http://www.imore.com/android-ui-smooth-ios
|