Swift vs Objective

编程入门 行业动态 更新时间:2024-10-21 06:23:42
本文介绍了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

本文发布于:2023-05-28 12:31:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/320954.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Swift   Objective

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!