Swift vs Objective-C:App性能 [英] Swift vs Objective-C: App performance

查看:169
本文介绍了Swift vs Objective-C:App性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Swift及其与Objective-C的不同之处。从我可以收集到的,当前版本的Swift比Objective-C更快,更快:请看这里

I am doing some research on Swift and its differences with Objective-C. From what I could gather, the current version of Swift is quite fast, faster even than Objective-C: see here.

但是,由于大多数这些测试是通过排序算法等完成的,我想知道当Swift用于开发时,它是否真的比Objective-C更快iOS应用。任何人都可以通过他们自己的经验来启发我。

However, since most of these tests are done with sorting algorithms and such, I am wondering if Swift will actually be faster than Objective-C when it is used for development of iOS apps. Can anyone enlighten me on this, preferably from their own experience.

推荐答案

关于Swift性能的提升,有一篇很棒的博客文章 之后 Swift 1.2发布。

There is a great blog-post about the improvement of Swift performance especially after the Swift 1.2 release.

作者使用不同类型的代码运行了几个测试,例如类似Objc的Swift代码,仅限Swift和仅使用Objective-c的代码。结果是,Swift 1.2比以前快得多。他使用JSON进行测试,所以它比算法更实用。

The author ran several tests with different kind of code like Objc-like Swift code, Swift only and Objective-c only code. And the result was, that Swift 1.2 is much faster than before. He ran tests with JSON so it's a bit more practical than just algorithms.

除了'真实'的表现,我个人的经验是,我正在发展很多在Swift中更容易。我从不喜欢Objective-C中的 .h .m 文件,因为它停止了编程流程。另外我认为语法本身比使用这些括号中的objective-c更容易。

Beside the 'real' performance, my personal experience about that is, that I'm developing much easier in Swift. I never liked the .h and .m files from Objective-C because it stopped the 'flow of programming'. Also I think the Syntax itself is much easier than in objective-c [with these brackets].

所以我认为,如果你从Scratch编写一个新项目,Swift会更容易,更快速,更优雅。 (我的意见)

So I think, if you write a new Project from Scratch, Swift is much easier, faster and more elegant. (My opinion)

这篇关于Swift vs Objective-C:App性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆